summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST.in18
-rw-r--r--Makefile11
-rw-r--r--cobbler.spec1
-rw-r--r--cobbler/action_check.py1
-rw-r--r--cobbler/action_enchant.py2
-rw-r--r--cobbler/action_import.py1
-rw-r--r--cobbler/action_litesync.py2
-rw-r--r--cobbler/action_status.py3
-rw-r--r--cobbler/action_sync.py3
-rw-r--r--cobbler/cexceptions.py3
-rwxr-xr-xcobbler/cobbler.py5
-rw-r--r--cobbler/cobbler_msg.py3
-rw-r--r--cobbler/cobblerd.py2
-rw-r--r--cobbler/collection_distros.py1
-rw-r--r--cobbler/collection_profiles.py2
-rw-r--r--cobbler/collection_repos.py2
-rw-r--r--cobbler/collection_systems.py2
-rw-r--r--cobbler/config.py3
-rw-r--r--cobbler/item.py1
-rw-r--r--cobbler/item_distro.py2
-rw-r--r--cobbler/item_profile.py2
-rw-r--r--cobbler/item_repo.py1
-rw-r--r--cobbler/item_system.py2
-rw-r--r--cobbler/serializable.py1
-rw-r--r--cobbler/serializer.py2
-rw-r--r--cobbler/settings.py1
-rw-r--r--cobbler/utils.py2
-rw-r--r--po/Makefile14
28 files changed, 79 insertions, 14 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index e15b039..eda9acd 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,19 +2,13 @@ include loaders/COPYING_ELILO
include loaders/elilo-3.6-ia64.efi
include loaders/menu.c32
include config/cobbler.conf
-include templates/dhcp.template
-include templates/dnsmasq.template
-include templates/pxeprofile.template
-include templates/pxedefault.template
-include templates/pxesystem.template
-include templates/pxesystem_ia64.template
-include kickstarts/kickstart_fc5.ks
-include kickstarts/kickstart_fc6.ks
-include kickstarts/kickstart_fc6_domU.ks
-include kickstarts/default.ks
+include config/rsync.exclude
+include config/cobblerd
+recursive-include templates *.template
+recursive-include kickstarts *.ks
include docs/cobbler.1.gz
include COPYING AUTHORS README CHANGELOG NEWS
-include config/rsync.exclude
include scripts/watcher.py
include scripts/cobblerd
-include config/cobblerd
+recursive-include po *.pot
+recursive-include po *.po
diff --git a/Makefile b/Makefile
index 6fa532a..769bbb0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+MESSAGESPOT=po/messages.pot
+
all: rpms
clean:
@@ -15,15 +17,20 @@ test:
python tests/tests.py
-rm -rf /tmp/_cobbler-*
-build: clean
+build: clean messages
python setup.py build -f
install: clean
python setup.py install -f
-sdist: clean
+sdist: clean messages
python setup.py sdist
+messages: cobbler/*.py
+ xgettext -k_ -kN_ -o $(MESSAGESPOT) cobbler/*.py
+ sed -i'~' -e 's/SOME DESCRIPTIVE TITLE/cobbler/g' -e 's/YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/2007 Red Hat, Inc. /g' -e 's/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/Michael DeHaan <mdehaan@redhat.com>, 2007/g' -e 's/PACKAGE VERSION/cobbler $(VERSION)-$(RELEASE)/g' -e 's/PACKAGE/cobbler/g' $(MESSAGESPOT)
+
+
rpms: manpage sdist
mkdir -p rpm-build
cp dist/*.gz rpm-build/
diff --git a/cobbler.spec b/cobbler.spec
index c2809b4..a18a053 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -14,6 +14,7 @@ Requires: createrepo
Requires: mod_python
Requires: python-cheetah
Requires: yum-utils
+Requires: rhpl
%ifarch i386 i686 x86_64
Requires: syslinux
%endif
diff --git a/cobbler/action_check.py b/cobbler/action_check.py
index 49ba174..17f4292 100644
--- a/cobbler/action_check.py
+++ b/cobbler/action_check.py
@@ -17,6 +17,7 @@ import os
import re
import cobbler_msg
import action_sync
+from rhpl.translate import _, N_, textdomain, utf8
class BootCheck:
diff --git a/cobbler/action_enchant.py b/cobbler/action_enchant.py
index a911c94..260d134 100644
--- a/cobbler/action_enchant.py
+++ b/cobbler/action_enchant.py
@@ -18,6 +18,8 @@ import os
import os.path
import sub_process
import traceback
+from rhpl.translate import _, N_, textdomain, utf8
+
class Enchant:
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index cd623a0..61c2d84 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -23,6 +23,7 @@ import glob
import api
import utils
import shutil
+from rhpl.translate import _, N_, textdomain, utf8
WGET_CMD = "wget --mirror --no-parent --no-host-directories --directory-prefix %s/%s %s"
RSYNC_CMD = "rsync -a %s %s %s/ks_mirror/%s --exclude-from=/etc/cobbler/rsync.exclude --delete --delete-excluded --progress"
diff --git a/cobbler/action_litesync.py b/cobbler/action_litesync.py
index c08690b..51369ee 100644
--- a/cobbler/action_litesync.py
+++ b/cobbler/action_litesync.py
@@ -32,6 +32,8 @@ import cexceptions
import traceback
import errno
+from rhpl.translate import _, N_, textdomain, utf8
+
class BootLiteSync:
"""
diff --git a/cobbler/action_status.py b/cobbler/action_status.py
index b3e94a2..9571d93 100644
--- a/cobbler/action_status.py
+++ b/cobbler/action_status.py
@@ -19,6 +19,9 @@ import glob
import time
import cobbler_msg
+from rhpl.translate import _, N_, textdomain, utf8
+
+
class BootStatusReport:
def __init__(self,config,mode):
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index d263aa3..226f5c0 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -34,6 +34,9 @@ import item_system
from Cheetah.Template import Template
+from rhpl.translate import _, N_, textdomain, utf8
+
+
class BootSync:
"""
Handles conversion of internal state to the tftpboot tree layout
diff --git a/cobbler/cexceptions.py b/cobbler/cexceptions.py
index 1052abe..a6e03dc 100644
--- a/cobbler/cexceptions.py
+++ b/cobbler/cexceptions.py
@@ -15,6 +15,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import exceptions
import cobbler_msg
+from rhpl.translate import _, N_, textdomain, utf8
+
+
class CobblerException(exceptions.Exception):
def __init__(self, value, *args):
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index 77e8a81..1264d23 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -23,6 +23,9 @@ import traceback
import cobbler_msg
import cexceptions
+from rhpl.translate import _, N_, textdomain, utf8
+I18N_DOMAIN = "cobbler"
+
LOCKING_ENABLED = True
LOCKFILE="/var/lib/cobbler/lock"
@@ -33,6 +36,7 @@ class BootCLI:
"""
Build the command line parser and API instances, etc.
"""
+ textdomain(I18N_DOMAIN)
self.args = args
self.api = api.BootAPI()
self.commands = {}
@@ -680,4 +684,5 @@ def main():
return exitcode
if __name__ == "__main__":
+ print _("Testing")
sys.exit(main())
diff --git a/cobbler/cobbler_msg.py b/cobbler/cobbler_msg.py
index d9f3183..a98ca77 100644
--- a/cobbler/cobbler_msg.py
+++ b/cobbler/cobbler_msg.py
@@ -16,6 +16,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
+from rhpl.translate import _, N_, textdomain, utf8
+
+
USAGE = """cobbler provisioning tool
basic usage guide / see "man cobbler" for more.
diff --git a/cobbler/cobblerd.py b/cobbler/cobblerd.py
index 263c9d5..9a384e9 100644
--- a/cobbler/cobblerd.py
+++ b/cobbler/cobblerd.py
@@ -17,6 +17,8 @@ import SimpleXMLRPCServer
import yaml # Howell Clark version
import api as cobbler_api
+from rhpl.translate import _, N_, textdomain, utf8
+
# hack to make xmlrpclib tolerate None:
# http://www.thescripts.com/forum/thread499321.html
diff --git a/cobbler/collection_distros.py b/cobbler/collection_distros.py
index 8662adf..dfcf8d4 100644
--- a/cobbler/collection_distros.py
+++ b/cobbler/collection_distros.py
@@ -18,6 +18,7 @@ import collection
import item_distro as distro
import cexceptions
import action_litesync
+from rhpl.translate import _, N_, textdomain, utf8
TESTMODE = False
diff --git a/cobbler/collection_profiles.py b/cobbler/collection_profiles.py
index 8425391..8a43b0e 100644
--- a/cobbler/collection_profiles.py
+++ b/cobbler/collection_profiles.py
@@ -20,6 +20,8 @@ import utils
import collection
import cexceptions
import action_litesync
+from rhpl.translate import _, N_, textdomain, utf8
+
TESTMODE = False
diff --git a/cobbler/collection_repos.py b/cobbler/collection_repos.py
index 18d4179..6596a66 100644
--- a/cobbler/collection_repos.py
+++ b/cobbler/collection_repos.py
@@ -18,6 +18,8 @@ import item_repo as repo
import utils
import collection
import cexceptions
+from rhpl.translate import _, N_, textdomain, utf8
+
TESTMODE = False
diff --git a/cobbler/collection_systems.py b/cobbler/collection_systems.py
index 139a71d..a336487 100644
--- a/cobbler/collection_systems.py
+++ b/cobbler/collection_systems.py
@@ -18,6 +18,8 @@ import utils
import collection
import cexceptions
import action_litesync
+from rhpl.translate import _, N_, textdomain, utf8
+
TESTMODE = False
diff --git a/cobbler/config.py b/cobbler/config.py
index 3a9bd79..92bd9b5 100644
--- a/cobbler/config.py
+++ b/cobbler/config.py
@@ -28,6 +28,9 @@ import collection_repos as repos
import settings
import serializer
+from rhpl.translate import _, N_, textdomain, utf8
+
+
class Config:
has_loaded = False
diff --git a/cobbler/item.py b/cobbler/item.py
index 1ccc84d..d4be1c7 100644
--- a/cobbler/item.py
+++ b/cobbler/item.py
@@ -15,6 +15,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import exceptions
import serializable
import utils
+from rhpl.translate import _, N_, textdomain, utf8
class Item(serializable.Serializable):
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index 3f5dcce..40a8a7e 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -20,6 +20,8 @@ import weakref
import os
import cexceptions
+from rhpl.translate import _, N_, textdomain, utf8
+
class Distro(item.Item):
#def __init__(self,config):
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index 0bd4b05..9e5f23d 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -16,6 +16,8 @@ import utils
import item
import cexceptions
+from rhpl.translate import _, N_, textdomain, utf8
+
class Profile(item.Item):
#def __init__(self,config):
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py
index 04327ec..9592ad2 100644
--- a/cobbler/item_repo.py
+++ b/cobbler/item_repo.py
@@ -15,6 +15,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import utils
import item
import cexceptions
+from rhpl.translate import _, N_, textdomain, utf8
# TODO: if distribution is detected FC6 or greater, auto-add the mirror stanza
# to the kickstart.
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index e481097..10a9593 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -15,6 +15,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import utils
import item
import cexceptions
+from rhpl.translate import _, N_, textdomain, utf8
+
class System(item.Item):
diff --git a/cobbler/serializable.py b/cobbler/serializable.py
index 62dfd01..ba8f015 100644
--- a/cobbler/serializable.py
+++ b/cobbler/serializable.py
@@ -13,6 +13,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
+from rhpl.translate import _, N_, textdomain, utf8
import exceptions
class Serializable:
diff --git a/cobbler/serializer.py b/cobbler/serializer.py
index 9a4925c..b74d6aa 100644
--- a/cobbler/serializer.py
+++ b/cobbler/serializer.py
@@ -19,6 +19,8 @@ import os
import cexceptions
import utils
+from rhpl.translate import _, N_, textdomain, utf8
+
def serialize(obj):
"""
Save an object to disk. Object must "implement" Serializable.
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 58995a4..406da12 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -14,6 +14,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import serializable
import utils
+from rhpl.translate import _, N_, textdomain, utf8
TESTMODE = False
diff --git a/cobbler/utils.py b/cobbler/utils.py
index e658583..3acf4c6 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -20,6 +20,8 @@ import sub_process
import shutil
import string
import traceback
+from rhpl.translate import _, N_, textdomain, utf8
+
_re_kernel = re.compile(r'vmlinuz(.*)')
_re_initrd = re.compile(r'initrd(.*).img')
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..ac8f6b9
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,14 @@
+#
+# copied from the gpodder makefile by Thomas Perl, also GPL
+
+update:
+ for langfile in *.po; do echo 'Compiling translation:' $${langfile}; mkdir -p ../locale/`basename $${langfile} .po`/LC_MESSAGES/; msgfmt $${langfile} -o ../locale/`basename $${langfile} .po`/LC_MESSAGES/vf_node_server.mo; done
+
+generators:
+ for langfile in *.po; do echo -n $${langfile}; msgmerge -U $${langfile} ../messages.pot; done
+
+clean:
+ rm -rf ../locale *~ *.mo
+
+.PHONY: update generators clean
+