jhbuild r2079 - in trunk: . jhbuild jhbuild/commands jhbuild/frontends jhbuild/modtypes jhbuild/utils jhbuild/versioncontrol po tests
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: jhbuild r2079 - in trunk: . jhbuild jhbuild/commands jhbuild/frontends jhbuild/modtypes jhbuild/utils jhbuild/versioncontrol po tests
- Date: Fri, 9 May 2008 22:56:43 +0100 (BST)
Author: fpeters
Date: Fri May 9 21:56:42 2008
New Revision: 2079
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2079&view=rev
Log:
* Makefile.plain, jhbuild/utils/packagedb.py, jhbuild/utils/unpack.py,
jhbuild/utils/httpcache.py, jhbuild/utils/cmds.py,
jhbuild/commands/autobuild.py, jhbuild/commands/base.py,
jhbuild/commands/info.py, jhbuild/commands/bootstrap.py,
jhbuild/commands/tinderbox.py, jhbuild/commands/__init__.py,
jhbuild/commands/checkbranches.py, jhbuild/commands/gui.py,
jhbuild/commands/rdepends.py, jhbuild/commands/sanitycheck.py,
jhbuild/frontends/autobuild.py, jhbuild/frontends/terminal.py,
jhbuild/frontends/gtkui.py, jhbuild/frontends/buildscript.py,
jhbuild/modtypes/autotools.py, jhbuild/modtypes/mozillamodule.py,
jhbuild/modtypes/waf.py, jhbuild/modtypes/__init__.py,
jhbuild/modtypes/linux.py, jhbuild/modtypes/cmake.py,
jhbuild/modtypes/perl.py, jhbuild/modtypes/distutils.py,
jhbuild/modtypes/mesa.py, jhbuild/versioncontrol/cvs.py,
jhbuild/versioncontrol/darcs.py, jhbuild/versioncontrol/arch.py,
jhbuild/versioncontrol/bzr.py, jhbuild/versioncontrol/hg.py,
jhbuild/versioncontrol/mtn.py, jhbuild/versioncontrol/__init__.py,
jhbuild/versioncontrol/tarball.py, jhbuild/versioncontrol/git.py,
jhbuild/versioncontrol/svn.py, jhbuild/moduleset.py,
jhbuild/monkeypatch.py, jhbuild/main.py, jhbuild/config.py,
tests/tests.py, onfigure.ac, Makefile.am, po/LINGUAS, po/fr.po,
po/Makevars, po/POTFILES.in: add gettext support, and a French
translation; patch by Claude Paroz, with a few fixes by myself
(closes: #531417)
Added:
trunk/po/ (props changed)
trunk/po/LINGUAS
trunk/po/Makevars
trunk/po/POTFILES.in
trunk/po/fr.po
Modified:
trunk/ (props changed)
trunk/ChangeLog
trunk/Makefile.am
trunk/Makefile.plain
trunk/configure.ac
trunk/jhbuild/commands/__init__.py
trunk/jhbuild/commands/autobuild.py
trunk/jhbuild/commands/base.py
trunk/jhbuild/commands/bootstrap.py
trunk/jhbuild/commands/checkbranches.py
trunk/jhbuild/commands/gui.py
trunk/jhbuild/commands/info.py
trunk/jhbuild/commands/rdepends.py
trunk/jhbuild/commands/sanitycheck.py
trunk/jhbuild/commands/tinderbox.py
trunk/jhbuild/config.py
trunk/jhbuild/frontends/autobuild.py
trunk/jhbuild/frontends/buildscript.py
trunk/jhbuild/frontends/gtkui.py
trunk/jhbuild/frontends/terminal.py
trunk/jhbuild/main.py
trunk/jhbuild/modtypes/__init__.py
trunk/jhbuild/modtypes/autotools.py
trunk/jhbuild/modtypes/cmake.py
trunk/jhbuild/modtypes/distutils.py
trunk/jhbuild/modtypes/linux.py
trunk/jhbuild/modtypes/mesa.py
trunk/jhbuild/modtypes/mozillamodule.py
trunk/jhbuild/modtypes/perl.py
trunk/jhbuild/modtypes/waf.py
trunk/jhbuild/moduleset.py
trunk/jhbuild/monkeypatch.py
trunk/jhbuild/utils/cmds.py
trunk/jhbuild/utils/httpcache.py
trunk/jhbuild/utils/packagedb.py
trunk/jhbuild/utils/unpack.py
trunk/jhbuild/versioncontrol/__init__.py
trunk/jhbuild/versioncontrol/arch.py
trunk/jhbuild/versioncontrol/bzr.py
trunk/jhbuild/versioncontrol/cvs.py
trunk/jhbuild/versioncontrol/darcs.py
trunk/jhbuild/versioncontrol/git.py
trunk/jhbuild/versioncontrol/hg.py
trunk/jhbuild/versioncontrol/mtn.py
trunk/jhbuild/versioncontrol/svn.py
trunk/jhbuild/versioncontrol/tarball.py
trunk/tests/tests.py
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Fri May 9 21:56:42 2008
@@ -1,13 +1,27 @@
+SUBDIRS = po
+
if DOC_INSTALLATION_ENABLED
-SUBDIRS = doc
+SUBDIRS += doc
endif
+
PATCHES = $(wildcard $(top_srcdir)/patches/*.patch)
-SOURCES = $(shell find $(top_srcdir)/jhbuild/ -name *.py -name *.glade) jhbuild/defaults.jhbuildrc
+SOURCES = $(shell find $(top_srcdir)/jhbuild/ -name *.py -or -name *.glade) jhbuild/defaults.jhbuildrc
MODULE_SETS = $(wildcard $(top_srcdir)/modulesets/*.modules) modulesets/moduleset.dtd
+INTLTOOL = \
+ intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in
+
EXTRA_DIST = gnome-doc-utils.make $(PATCHES) $(SOURCES) $(MODULE_SETS) \
- scripts/hg-update.py Makefile.plain install-check.c
+ scripts/hg-update.py Makefile.plain install-check.c \
+ po/Makefile.plain $(INTLTOOL)
+
+DISTCLEANFILES = \
+ intltool-extract \
+ intltool-merge \
+ intltool-update
# those won't be executed by make distcheck, it is necessary as they build
# in source tree and do install to ~/bin/
Modified: trunk/Makefile.plain
==============================================================================
--- trunk/Makefile.plain (original)
+++ trunk/Makefile.plain Fri May 9 21:56:42 2008
@@ -4,6 +4,7 @@
CC = gcc
CFLAGS = -Wall -O2
+SUBDIRS = po
bindir=$(HOME)/bin
desktopdir=$(HOME)/.local/share/applications
@@ -15,8 +16,10 @@
update:
svn update --quiet
+ cd po && make
install: install-check
+ cd po && make -f Makefile.plain install
@echo "Creating $(bindir)/jhbuild"
@mkdir -p $(bindir)
@sed "s,@jhbuilddir@,`pwd`,g" < jhbuild.in > $(bindir)/jhbuild
@@ -52,6 +55,8 @@
cp -p jhbuild/modtypes/*.py $(distdir)/jhbuild/modtypes/
mkdir $(distdir)/jhbuild/utils
cp -p jhbuild/utils/*.py $(distdir)/jhbuild/utils/
+ mkdir $(distdir)/po
+ cp -p po/* $(distdir)/po/
mkdir $(distdir)/scripts
cp -p scripts/*.py scripts/*.xsl scripts/*.deps scripts/*.exceptions $(distdir)/scripts/
mkdir $(distdir)/scripts/branch-violations
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri May 9 21:56:42 2008
@@ -1,10 +1,17 @@
-AC_INIT([jhbuild], [2.21.5],
+AC_INIT([jhbuild], [2.23.1],
[http://bugzilla.gnome.org/enter_bug.cgi?product=jhbuild])
AC_CONFIG_SRCDIR(jhbuild/main.py)
AM_INIT_AUTOMAKE
GNOME_COMMON_INIT
AM_MAINTAINER_MODE
+# i18n
+GETTEXT_PACKAGE="jhbuild"
+AC_SUBST([GETTEXT_PACKAGE])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package])
+AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.35.0])
+
AC_PROG_CC
PKG_PROG_PKG_CONFIG
@@ -22,5 +29,6 @@
AC_CONFIG_FILES([
Makefile
doc/Makefile
+ po/Makefile.in
])
AC_OUTPUT
Modified: trunk/jhbuild/commands/__init__.py
==============================================================================
--- trunk/jhbuild/commands/__init__.py (original)
+++ trunk/jhbuild/commands/__init__.py Fri May 9 21:56:42 2008
@@ -32,8 +32,9 @@
class Command:
"""Base class for Command objects"""
+ doc = ''
name = None
- usage_args = '[ options ... ]'
+ usage_args = _('[ options ... ]')
def __init__(self, options=[]):
self.options = options
@@ -45,7 +46,7 @@
def parse_args(self, args):
self.parser = optparse.OptionParser(
usage='%%prog %s %s' % (self.name, self.usage_args),
- description=self.__doc__)
+ description=self.doc)
self.parser.add_options(self.options)
return self.parser.parse_args(args)
@@ -70,7 +71,7 @@
except ImportError:
pass
if command not in _commands:
- raise FatalError('command not found')
+ raise FatalError(_('command not found'))
command_class = _commands[command]
cmd = command_class()
Modified: trunk/jhbuild/commands/autobuild.py
==============================================================================
--- trunk/jhbuild/commands/autobuild.py (original)
+++ trunk/jhbuild/commands/autobuild.py Fri May 9 21:56:42 2008
@@ -24,7 +24,7 @@
import jhbuild.frontends
class cmd_autobuild(Command):
- '''Build modules non-interactively and upload results to JhAutobuild'''
+ doc = _('Build modules non-interactively and upload results to JhAutobuild')
name = 'autobuild'
@@ -32,22 +32,22 @@
Command.__init__(self, [
make_option('-a', '--autogen',
action='store_true', dest='autogen', default=False,
- help='always run autogen.sh'),
+ help=_('always run autogen.sh')),
make_option('-c', '--clean',
action='store_true', dest='clean', default=False,
- help='run make clean before make'),
+ help=_('run make clean before make')),
make_option('-s', '--skip', metavar='MODULES',
action='append', dest='skip', default=[],
- help='treat the given modules as up to date'),
+ help=_('treat the given modules as up to date')),
make_option('-t', '--start-at', metavar='MODULE',
action='store', dest='startat', default=None,
- help='start building at the given module'),
+ help=_('start building at the given module')),
make_option('-r', '--report-url',
action='store', dest='reporturl', default=None,
- help='jhautobuild report URL'),
+ help=_('jhautobuild report URL')),
make_option('-v', '--verbose',
action='store_true', dest='verbose', default=False,
- help='verbose mode'),
+ help=_('verbose mode')),
])
def run(self, config, options, args):
@@ -66,7 +66,7 @@
config.verbose = True
if not config.autobuild_report_url:
- raise UsageError('report url for autobuild not specified')
+ raise UsageError(_('report url for autobuild not specified'))
module_set = jhbuild.moduleset.load(config)
module_list = module_set.get_module_list(args or config.modules,
@@ -77,7 +77,7 @@
while module_list and module_list[0].name != options.startat:
del module_list[0]
if not module_list:
- raise FatalError('%s not in module list' % options.startat)
+ raise FatalError(_('%s not in module list') % options.startat)
build = jhbuild.frontends.get_buildscript(config, module_list)
build.build()
Modified: trunk/jhbuild/commands/base.py
==============================================================================
--- trunk/jhbuild/commands/base.py (original)
+++ trunk/jhbuild/commands/base.py Fri May 9 21:56:42 2008
@@ -35,11 +35,11 @@
coeffs = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
return float(m.group(1)) * coeffs[m.group(2)]
else:
- raise ValueError('unable to parse \'%s\' as relative time.' % s)
+ raise ValueError(_('unable to parse \'%s\' as relative time.') % s)
class cmd_update(Command):
- """Update all modules from version control"""
+ doc = _('Update all modules from version control')
name = 'update'
usage_args = '[ options ... ] [ modules ... ]'
@@ -48,16 +48,16 @@
Command.__init__(self, [
make_option('-s', '--skip', metavar='MODULES',
action='append', dest='skip', default=[],
- help='treat the given modules as up to date'),
+ help=_('treat the given modules as up to date')),
make_option('-t', '--start-at', metavar='MODULE',
action='store', dest='startat', default=None,
- help='start building at the given module'),
+ help=_('start building at the given module')),
make_option('--tags',
action='append', dest='tags', default=[],
- help='build only modules with the given tags'),
+ help=_('build only modules with the given tags')),
make_option('-D', metavar='DATE-SPEC',
action='store', dest='sticky_date', default=None,
- help='set a sticky date when checking out modules'),
+ help=_('set a sticky date when checking out modules')),
])
def run(self, config, options, args):
@@ -76,7 +76,7 @@
while module_list and module_list[0].name != options.startat:
del module_list[0]
if not module_list:
- raise FatalError('%s not in module list' % options.startat)
+ raise FatalError(_('%s not in module list') % options.startat)
# don't actually perform build ...
config.nobuild = True
@@ -89,7 +89,7 @@
class cmd_updateone(Command):
- """Update one or more modules from version control"""
+ doc = _('Update one or more modules from version control')
name = 'updateone'
usage_args = '[ options ... ] [ modules ... ]'
@@ -98,7 +98,7 @@
Command.__init__(self, [
make_option('-D', metavar='DATE-SPEC',
action='store', dest='sticky_date', default=None,
- help='set a sticky date when checking out modules'),
+ help=_('set a sticky date when checking out modules')),
])
def run(self, config, options, args):
@@ -109,11 +109,11 @@
try:
module_list = [module_set.modules[modname] for modname in args]
except KeyError, e:
- raise FatalError("A module called '%s' could not be found."
+ raise FatalError(_("A module called '%s' could not be found.")
% str(e))
if not module_list:
- self.parser.error('This command requires a module parameter.')
+ self.parser.error(_('This command requires a module parameter.'))
# don't actually perform build ...
config.nobuild = True
@@ -126,61 +126,61 @@
class cmd_build(Command):
- """Update and compile all modules (the default)"""
+ doc = _('Update and compile all modules (the default)')
name = 'build'
- usage_args = '[ options ... ] [ modules ... ]'
+ usage_args = _('[ options ... ] [ modules ... ]')
def __init__(self):
Command.__init__(self, [
make_option('-a', '--autogen',
action='store_true', dest='autogen', default=False,
- help='always run autogen.sh'),
+ help=_('always run autogen.sh')),
make_option('-c', '--clean',
action='store_true', dest='clean', default=False,
- help='run make clean before make'),
+ help=_('run make clean before make')),
make_option('-d', '--dist',
action='store_true', dest='dist', default=False,
- help='run make dist after building'),
+ help=_('run make dist after building')),
make_option('--distcheck',
action='store_true', dest='distcheck', default=False,
- help='run make distcheck after building'),
+ help=_('run make distcheck after building')),
make_option('-n', '--no-network',
action='store_true', dest='nonetwork', default=False,
- help='skip version control update'),
+ help=_('skip version control update')),
make_option('-q', '--quiet',
action='store_true', dest='quiet', default=False,
- help='quiet (no output)'),
+ help=_('quiet (no output)')),
make_option('-s', '--skip', metavar='MODULES',
action='append', dest='skip', default=[],
- help='treat the given modules as up to date'),
+ help=_('treat the given modules as up to date')),
make_option('-t', '--start-at', metavar='MODULE',
action='store', dest='startat', default=None,
- help='start building at the given module'),
+ help=_('start building at the given module')),
make_option('--tags',
action='append', dest='tags', default=[],
- help='build only modules with the given tags'),
+ help=_('build only modules with the given tags')),
make_option('-D', metavar='DATE-SPEC',
action='store', dest='sticky_date', default=None,
- help='set a sticky date when checking out modules'),
+ help=_('set a sticky date when checking out modules')),
make_option('-x', '--no-xvfb',
action='store_true', dest='noxvfb', default=False,
- help='run tests in real X and not in Xvfb'),
+ help=_('run tests in real X and not in Xvfb')),
make_option('-C', '--try-checkout',
action='store_true', dest='trycheckout', default=False,
- help='try to force checkout and autogen on failure'),
+ help=_('try to force checkout and autogen on failure')),
make_option('-N', '--no-poison',
action='store_true', dest='nopoison', default=False,
- help="don't poison modules on failure"),
+ help=_("don't poison modules on failure")),
make_option('-f', '--force',
action='store_true', dest='force_policy', default=False,
- help="build even if policy says not to"),
+ help=_('build even if policy says not to')),
make_option('--build-optional-modules',
action='store_true', dest='build_optional_modules', default=False,
- help="also build soft-dependencies that could be skipped"),
+ help=_('also build soft-dependencies that could be skipped')),
make_option('--min-age', metavar='TIME-SPEC',
action='store', dest='min_age', default=None,
- help='skip modules installed less than the given time ago'),
+ help=_('skip modules installed less than the given time ago')),
])
def run(self, config, options, args):
@@ -222,7 +222,7 @@
while module_list and module_list[0].name != options.startat:
del module_list[0]
if not module_list:
- raise FatalError('%s not in module list' % options.startat)
+ raise FatalError(_('%s not in module list') % options.startat)
build = jhbuild.frontends.get_buildscript(config, module_list)
return build.build()
@@ -231,43 +231,43 @@
class cmd_buildone(Command):
- """Update and compile one or more modules"""
+ doc = _('Update and compile one or more modules')
name = 'buildone'
- usage_args = '[ options ... ] [ modules ... ]'
+ usage_args = _('[ options ... ] [ modules ... ]')
def __init__(self):
Command.__init__(self, [
make_option('-a', '--autogen',
action='store_true', dest='autogen', default=False,
- help='always run autogen.sh'),
+ help=_('always run autogen.sh')),
make_option('-c', '--clean',
action='store_true', dest='clean', default=False,
- help='run make clean before make'),
+ help=_('run make clean before make')),
make_option('-d', '--dist',
action='store_true', dest='dist', default=False,
- help='run make dist after building'),
+ help=_('run make dist after building')),
make_option('--distcheck',
action='store_true', dest='distcheck', default=False,
- help='run make distcheck after building'),
+ help=_('run make distcheck after building')),
make_option('-n', '--no-network',
action='store_true', dest='nonetwork', default=False,
- help='skip version control update'),
+ help=_('skip version control update')),
make_option('-q', '--quiet',
action='store_true', dest='quiet', default=False,
- help='quiet (no output)'),
+ help=_('quiet (no output)')),
make_option('-D', metavar='DATE-SPEC',
action='store', dest='sticky_date', default=None,
- help='set a sticky date when checking out modules'),
+ help=_('set a sticky date when checking out modules')),
make_option('-x', '--no-xvfb',
action='store_true', dest='noxvfb', default=False,
- help='Run tests in real X and not in Xvfb'),
+ help=_('run tests in real X and not in Xvfb')),
make_option('-f', '--force',
action='store_true', dest='force_policy', default=False,
- help="build even if policy says not to"),
+ help=_('build even if policy says not to')),
make_option('--min-age', metavar='TIME-SPEC',
action='store', dest='min_age', default=None,
- help='skip modules installed less than the given time ago'),
+ help=_('skip modules installed less than the given time ago')),
])
def run(self, config, options, args):
@@ -296,11 +296,11 @@
try:
module_list = [module_set.modules[modname] for modname in args]
except KeyError, e:
- raise FatalError("A module called '%s' could not be found."
+ raise FatalError(_("A module called '%s' could not be found.")
% str(e))
if not module_list:
- self.parser.error('This command requires a module parameter.')
+ self.parser.error(_('This command requires a module parameter.'))
build = jhbuild.frontends.get_buildscript(config, module_list)
return build.build()
@@ -309,16 +309,16 @@
class cmd_run(Command):
- """Run a command under the JHBuild environment"""
+ doc = _('Run a command under the JHBuild environment')
name = 'run'
- usage_args = '[ options ... ] program [ arguments ... ]'
+ usage_args = _('[ options ... ] program [ arguments ... ]')
def __init__(self):
Command.__init__(self, [
make_option('--in-builddir', metavar='MODULE',
action='store', dest='in_builddir', default = None,
- help='run command in build dir of the given module'),
+ help=_('run command in build dir of the given module')),
])
def execute(self, config, args):
@@ -328,8 +328,8 @@
try:
return os.execlp(args[0], *args)
except OSError, exc:
- raise FatalError("Unable to execute the command '%s': %s" % (
- args[0], str(exc)))
+ raise FatalError(_("Unable to execute the command '%(command)s': %(err)s") % {
+ 'command':args[0], 'err':str(exc)})
def run(self, config, options, args):
if options.in_builddir:
@@ -337,7 +337,7 @@
try:
module_list = [module_set.modules[options.in_builddir]]
except KeyError, e:
- raise FatalError("A module called '%s' could not be found." % e)
+ raise FatalError(_("A module called '%s' could not be found.") % e)
build = jhbuild.frontends.get_buildscript(config, module_list)
builddir = module_list[0].get_builddir(build)
@@ -345,23 +345,23 @@
build.execute(args, cwd=builddir)
except CommandError, exc:
if args:
- raise FatalError("Unable to execute the command '%s'" % args[0])
+ raise FatalError(_("Unable to execute the command '%s'") % args[0])
else:
raise FatalError(str(exc))
else:
try:
os.execlp(args[0], *args)
except IndexError:
- raise FatalError('No command given')
+ raise FatalError(_('No command given'))
except OSError, exc:
- raise FatalError("Unable to execute the command '%s': %s" % (
- args[0], str(exc)))
+ raise FatalError(_("Unable to execute the command '%(command)s': %(err)s") % {
+ 'command':args[0], 'err':str(exc)})
register_command(cmd_run)
class cmd_shell(Command):
- """Start a shell under the JHBuild environment"""
+ doc = _('Start a shell under the JHBuild environment')
name = 'shell'
usage_args = ''
@@ -376,25 +376,25 @@
class cmd_list(Command):
- """List the modules that would be built"""
+ doc = _('List the modules that would be built')
name = 'list'
- usage_args = '[ options ... ] [ modules ... ]'
+ usage_args = _('[ options ... ] [ modules ... ]')
def __init__(self):
Command.__init__(self, [
make_option('-r', '--show-revision',
action='store_true', dest='show_rev', default=False,
- help='show which revision will be built'),
+ help=_('show which revision will be built')),
make_option('-s', '--skip', metavar='MODULES',
action='append', dest='skip', default=[],
- help='treat the given modules as up to date'),
+ help=_('treat the given modules as up to date')),
make_option('--tags',
action='append', dest='tags', default=[],
- help='build only modules with the given tags'),
+ help=_('build only modules with the given tags')),
make_option('--list-optional-modules',
action='store_true', dest='list_optional_modules', default=False,
- help="also list soft-dependencies that could be skipped"),
+ help=_('also list soft-dependencies that could be skipped')),
])
def run(self, config, options, args):
@@ -421,19 +421,19 @@
class cmd_dot(Command):
- """Output a Graphviz dependency graph for one or more modules"""
+ doc = _('Output a Graphviz dependency graph for one or more modules')
name = 'dot'
- usage_args = '[ modules ... ]'
+ usage_args = _('[ modules ... ]')
def __init__(self):
Command.__init__(self, [
make_option('--soft-deps',
action='store_true', dest='soft_deps', default=False,
- help='add dotted lines to soft dependencies'),
+ help=_('add dotted lines to soft dependencies')),
make_option('--clusters',
action='store_true', dest='clusters', default=False,
- help='group modules from metamodule together'),
+ help=_('group modules from metamodule together')),
])
def run(self, config, options, args):
Modified: trunk/jhbuild/commands/bootstrap.py
==============================================================================
--- trunk/jhbuild/commands/bootstrap.py (original)
+++ trunk/jhbuild/commands/bootstrap.py Fri May 9 21:56:42 2008
@@ -26,7 +26,7 @@
from jhbuild.commands.base import cmd_build
class cmd_bootstrap(cmd_build):
- """Build required support tools"""
+ doc = _('Build required support tools')
name = 'bootstrap'
Modified: trunk/jhbuild/commands/checkbranches.py
==============================================================================
--- trunk/jhbuild/commands/checkbranches.py (original)
+++ trunk/jhbuild/commands/checkbranches.py Fri May 9 21:56:42 2008
@@ -26,7 +26,7 @@
from jhbuild.commands import Command, register_command
class cmd_checkbranches(Command):
- """Check modules in GNOME svn have the correct branch definition"""
+ doc = _('Check modules in GNOME subversion have the correct branch definition')
name = 'checkbranches'
def __init__(self):
@@ -63,7 +63,7 @@
except urllib2.URLError:
pass
else:
- print mod.name, 'is missing branch definition for', branch
+ print _('%(module)s is missing branch definition for %(branch)s') % {'module': mod.name, 'branch': branch}
register_command(cmd_checkbranches)
Modified: trunk/jhbuild/commands/gui.py
==============================================================================
--- trunk/jhbuild/commands/gui.py (original)
+++ trunk/jhbuild/commands/gui.py Fri May 9 21:56:42 2008
@@ -24,7 +24,7 @@
class cmd_gui(Command):
- """Build targets from a GUI app"""
+ doc = _('Build targets from a GUI app')
name = 'gui'
usage_args = ''
Modified: trunk/jhbuild/commands/info.py
==============================================================================
--- trunk/jhbuild/commands/info.py (original)
+++ trunk/jhbuild/commands/info.py Fri May 9 21:56:42 2008
@@ -36,10 +36,10 @@
class cmd_info(Command):
- """Display information about one or more modules"""
+ doc = _('Display information about one or more modules')
name = 'info'
- usage_args = '[ modules ... ]'
+ usage_args = _('[ modules ... ]')
def run(self, config, options, args):
@@ -51,7 +51,7 @@
try:
module = module_set.modules[modname]
except KeyError:
- raise FatalError('unknown module %s' % modname)
+ raise FatalError(_('unknown module %s') % modname)
self.show_info(module, packagedb, module_set)
else:
for module in module_set.modules.values():
@@ -60,59 +60,59 @@
def show_info(self, module, packagedb, module_set):
installdate = packagedb.installdate(module.name, module.get_revision() or '')
- print 'Name:', module.name
- print 'Module Set:', module.moduleset_name
- print 'Type:', module.type
+ print _('Name:'), module.name
+ print _('Module Set:'), module.moduleset_name
+ print _('Type:'), module.type
if installdate is not None:
- print 'Install-date:', time.strftime('%Y-%m-%d %H:%M:%S',
+ print _('Install-date:'), time.strftime('%Y-%m-%d %H:%M:%S',
time.localtime(installdate))
else:
- print 'Install-date:', 'not installed'
+ print _('Install-date:'), _('not installed')
if isinstance(module, MozillaModule):
if module.projects:
- print 'Moz-Projects:', ', '.join(module.projects)
+ print _('Moz-Projects:'), ', '.join(module.projects)
if isinstance(module, MetaModule):
pass
elif isinstance(module.branch, CVSBranch):
- print 'CVS-Root:', module.branch.repository.cvsroot
- print 'CVS-Module:', module.branch.module
+ print _('CVS-Root:'), module.branch.repository.cvsroot
+ print _('CVS-Module:'), module.branch.module
if module.branch.revision:
- print 'CVS-Revision:', module.branch.revision
+ print _('CVS-Revision:'), module.branch.revision
elif isinstance(module.branch, SubversionBranch):
- print 'Subversion-Module:', module.branch.module
+ print _('Subversion-Module:'), module.branch.module
elif isinstance(module.branch, ArchBranch):
- print 'Arch-Version:', module.branch.module
+ print _('Arch-Version:'), module.branch.module
elif isinstance(module.branch, DarcsBranch):
- print 'Darcs-Archive:', module.branch.module
+ print _('Darcs-Archive:'), module.branch.module
elif isinstance(module.branch, GitBranch):
- print 'Git-Module:', module.branch.module
+ print _('Git-Module:'), module.branch.module
elif isinstance(module.branch, TarballBranch):
- print 'URL:', module.branch.module
- print 'Version:', module.branch.version
+ print _('URL:'), module.branch.module
+ print _('Version:'), module.branch.version
try:
tree_id = module.branch.tree_id()
- print 'Tree-ID:', tree_id
+ print _('Tree-ID:'), tree_id
except (NotImplementedError, AttributeError):
pass
# dependencies
if module.dependencies:
- print 'Requires:', ', '.join(module.dependencies)
+ print _('Requires:'), ', '.join(module.dependencies)
requiredby = [ mod.name for mod in module_set.modules.values()
if module.name in mod.dependencies ]
if requiredby:
- print 'Required-by:', ', '.join(requiredby)
+ print _('Required-by:'), ', '.join(requiredby)
if module.suggests:
- print 'Suggests:', ', '.join(module.suggests)
+ print _('Suggests:'), ', '.join(module.suggests)
if module.after:
- print 'After:', ', '.join(module.after)
+ print _('After:'), ', '.join(module.after)
before = [ mod.name for mod in module_set.modules.values()
if module.name in mod.after ]
if before:
- print 'Before:', ', '.join(before)
+ print _('Before:'), ', '.join(before)
print
Modified: trunk/jhbuild/commands/rdepends.py
==============================================================================
--- trunk/jhbuild/commands/rdepends.py (original)
+++ trunk/jhbuild/commands/rdepends.py Fri May 9 21:56:42 2008
@@ -24,26 +24,26 @@
class cmd_rdepends(Command):
- """Display reverse-dependencies of a module"""
+ doc = _('Display reverse-dependencies of a module')
name = 'rdepends'
- usage_args = '[ module ]'
+ usage_args = _('[ module ]')
def __init__(self):
Command.__init__(self, [
make_option('--dependencies',
action='store_true', dest='dependencies', default=False,
- help='display dependency path next to modules'),
+ help=_('display dependency path next to modules')),
make_option('--direct',
action='store_true', dest='direct', default=False,
- help='limit display to modules directly depending on given module')
+ help=_('limit display to modules directly depending on given module'))
])
def run(self, config, options, args):
module_set = jhbuild.moduleset.load(config)
if not args:
- self.parser.error('This command requires a module parameter.')
+ self.parser.error(_('This command requires a module parameter.'))
modname = args[0]
Modified: trunk/jhbuild/commands/sanitycheck.py
==============================================================================
--- trunk/jhbuild/commands/sanitycheck.py (original)
+++ trunk/jhbuild/commands/sanitycheck.py Fri May 9 21:56:42 2008
@@ -71,51 +71,51 @@
class cmd_sanitycheck(Command):
- """Check that required support tools are available"""
+ doc = _('Check that required support tools are available')
name = 'sanitycheck'
usage_args = ''
def run(self, config, options, args):
if args:
- raise UsageError('no extra arguments expected')
+ raise UsageError(_('no extra arguments expected'))
# check whether the checkout root and install prefix are writable
if not (os.path.isdir(config.checkoutroot) and
os.access(config.checkoutroot, os.R_OK|os.W_OK|os.X_OK)):
- print 'checkout root is not writable'
+ print _('checkout root is not writable')
if not (os.path.isdir(config.prefix) and
os.access(config.prefix, os.R_OK|os.W_OK|os.X_OK)):
- print 'install prefix is not writable'
+ print _('install prefix is not writable')
# check whether various tools are installed
if not check_version(['libtoolize', '--version'],
r'libtoolize \([^)]*\) ([\d.]+)', '1.5'):
- print 'libtool >= 1.5 not found'
+ print _('%s not found') % 'libtool >= 1.5'
if not check_version(['gettext', '--version'],
r'gettext \([^)]*\) ([\d.]+)', '0.10.40'):
- print 'gettext >= 0.10.40 not found'
+ print _('%s not found') % 'gettext >= 0.10.40'
if not check_version(['pkg-config', '--version'],
r'^([\d.]+)', '0.14.0'):
- print 'pkg-config >= 0.14.0 not found'
+ print _('%s not found') % 'pkg-config >= 0.14.0'
if not check_version(['db2html', '--version'],
r'.* ([\d.]+)', '0.0'):
- print 'db2html not found'
+ print _('%s not found') % 'db2html'
if not check_version(['autoconf', '--version'],
r'autoconf \([^)]*\) ([\d.]+)', '2.53'):
- print 'autoconf >= 2.53 not found'
+ print _('%s not found') % 'autoconf >= 2.53'
if not check_version(['automake-1.4', '--version'],
r'automake \([^)]*\) ([\d.]+)', '1.4'):
- print 'automake-1.4 not found'
+ print _('%s not found') % 'automake-1.4'
if not check_version(['automake-1.7', '--version'],
r'automake \([^)]*\) ([\d.]+)', '1.7'):
- print 'automake-1.7 not found'
+ print _('%s not found') % 'automake-1.7'
if not check_version(['automake-1.8', '--version'],
r'automake \([^)]*\) ([\d.]+)', '1.8'):
- print 'automake-1.8 not found'
+ print _('%s not found') % 'automake-1.8'
if not check_version(['automake-1.9', '--version'],
r'automake \([^)]*\) ([\d.]+)', '1.9'):
- print 'automake-1.9 not found'
+ print _('%s not found') % 'automake-1.9'
for amver in ('1.4', '1.7', '1.8', '1.9'):
try:
@@ -124,15 +124,15 @@
continue # exception raised if aclocal-ver not runnable
if not inpath('libtool.m4', path):
- print "aclocal-%s can't see libtool macros" % amver
+ print _("aclocal-%s can't see libtool macros") % amver
if not inpath('gettext.m4', path):
- print "aclocal-%s can't see gettext macros" % amver
+ print _("aclocal-%s can't see gettext macros") % amver
if not inpath('pkg.m4', path):
- print "aclocal-%s can't see pkg-config macros" % amver
+ print _("aclocal-%s can't see pkg-config macros") % amver
# XML catalog sanity checks
if not os.access('/etc/xml/catalog', os.R_OK):
- print 'Could not find XML catalog'
+ print _('Could not find XML catalog')
else:
for (item, name) in [('-//OASIS//DTD DocBook XML V4.1.2//EN',
'DocBook XML DTD V4.1.2'),
@@ -141,36 +141,36 @@
try:
data = get_output(['xmlcatalog', '/etc/xml/catalog', item])
except:
- print 'Could not find %s in XML catalog' % name
+ print _('Could not find %s in XML catalog') % name
# Perl modules used by tools such as intltool:
for perlmod in [ 'XML::Parser' ]:
try:
get_output(['perl', '-M%s' % perlmod, '-e', 'exit'])
except:
- print 'Could not find the perl module %s' % perlmod
+ print _('Could not find the perl module %s') % perlmod
# check for cvs:
if not inpath('cvs', os.environ['PATH'].split(os.pathsep)):
- print 'cvs not found'
+ print _('%s not found') % 'cvs'
# check for svn:
if not inpath('svn', os.environ['PATH'].split(os.pathsep)):
- print 'svn not found'
+ print _('%s not found') % 'svn'
# check for git:
if not inpath('git', os.environ['PATH'].split(os.pathsep)):
- print 'git not found'
+ print _('%s not found') % 'git'
else:
try:
git_help = os.popen('git --help', 'r').read()
if not 'clone' in git_help:
- print 'Installed git program is not the right git'
+ print _('Installed git program is not the right git')
except:
- print 'Could not check git program'
+ print _('Could not check git program')
# check for svn:
if not inpath('svn', os.environ['PATH'].split(os.pathsep)):
- print 'svn not found'
+ print _('%s not found') % 'svn'
register_command(cmd_sanitycheck)
Modified: trunk/jhbuild/commands/tinderbox.py
==============================================================================
--- trunk/jhbuild/commands/tinderbox.py (original)
+++ trunk/jhbuild/commands/tinderbox.py Fri May 9 21:56:42 2008
@@ -25,40 +25,40 @@
class cmd_tinderbox(Command):
- """Build modules non-interactively and store build logs"""
+ doc = _('Build modules non-interactively and store build logs')
name = 'tinderbox'
- usage_args = '[ options ... ] [ modules ... ]'
+ usage_args = _('[ options ... ] [ modules ... ]')
def __init__(self):
Command.__init__(self, [
make_option('-a', '--autogen',
action='store_true', dest='autogen', default=False,
- help='always run autogen.sh'),
+ help=_('always run autogen.sh')),
make_option('-c', '--clean',
action='store_true', dest='clean', default=False,
- help='run make clean before make'),
+ help=_('run make clean before make')),
make_option('-n', '--no-network',
action='store_true', dest='nonetwork', default=False,
- help='skip version control update'),
+ help=_('skip version control update')),
make_option('-o', '--output', metavar='DIR',
action='store', dest='outputdir', default=None,
- help='directory to store build logs in'),
+ help=_('directory to store build logs in')),
make_option('-s', '--skip', metavar='MODULES',
action='append', dest='skip', default=[],
- help='treat the given modules as up to date'),
+ help=_('treat the given modules as up to date')),
make_option('-t', '--start-at', metavar='MODULE',
action='store', dest='startat', default=None,
- help='start building at the given module'),
+ help=_('start building at the given module')),
make_option('-D', metavar='DATE-SPEC',
action='store', dest='sticky_date', default=None,
- help='set a sticky date when checking out modules'),
+ help=_('set a sticky date when checking out modules')),
make_option('-C', '--try-checkout',
action='store_true', dest='trycheckout', default=False,
- help='try to force checkout and autogen on failure'),
+ help=_('try to force checkout and autogen on failure')),
make_option('-N', '--no-poison',
action='store_true', dest='nopoison', default=False,
- help="don't poison modules on failure")
+ help=_("don't poison modules on failure"))
])
def run(self, config, options, args):
@@ -82,8 +82,7 @@
config.nopoison = True
if not config.tinderbox_outputdir:
- raise UsageError('output directory for tinderbox build '
- 'not specified')
+ raise UsageError(_('output directory for tinderbox build not specified'))
module_set = jhbuild.moduleset.load(config)
module_list = module_set.get_module_list(args or config.modules,
@@ -94,7 +93,7 @@
while module_list and module_list[0].name != options.startat:
del module_list[0]
if not module_list:
- raise FatalError('%s not in module list' % options.startat)
+ raise FatalError(_('%s not in module list') % options.startat)
build = jhbuild.frontends.get_buildscript(config, module_list)
build.build()
Modified: trunk/jhbuild/config.py
==============================================================================
--- trunk/jhbuild/config.py (original)
+++ trunk/jhbuild/config.py Fri May 9 21:56:42 2008
@@ -96,13 +96,13 @@
execfile(_defaults_file, config)
except:
traceback.print_exc()
- raise FatalError('could not load config defaults')
+ raise FatalError(_('could not load config defaults'))
config['__file__'] = filename
try:
execfile(filename, config)
except Exception:
traceback.print_exc()
- raise FatalError('could not load config file')
+ raise FatalError(_('could not load config file'))
# backward compatibility, from the days when jhbuild only
# supported Gnome.org CVS.
@@ -129,10 +129,10 @@
# check possible checkout_mode values
possible_checkout_modes = ('update', 'clobber', 'export', 'copy')
if self.checkout_mode not in possible_checkout_modes:
- raise FatalError('invalid checkout mode')
+ raise FatalError(_('invalid checkout mode'))
for module, checkout_mode in self.module_checkout_mode.items():
if checkout_mode not in possible_checkout_modes:
- raise FatalError('invalid checkout mode (module: %s)' % module)
+ raise FatalError(_('invalid checkout mode (module: %s)') % module)
self.setup_env()
@@ -143,7 +143,7 @@
try:
os.makedirs(self.prefix)
except:
- raise FatalError("Can't create %s directory" % self.prefix)
+ raise FatalError(_("Can't create %s directory") % self.prefix)
#includedir = os.path.join(prefix, 'include')
#addpath('C_INCLUDE_PATH', includedir)
@@ -182,7 +182,7 @@
try:
os.makedirs(aclocaldir)
except:
- raise FatalError("Can't create %s directory" % aclocaldir)
+ raise FatalError(_("Can't create %s directory") % aclocaldir)
addpath('ACLOCAL_FLAGS', aclocaldir)
# PERL5LIB
Modified: trunk/jhbuild/frontends/autobuild.py
==============================================================================
--- trunk/jhbuild/frontends/autobuild.py (original)
+++ trunk/jhbuild/frontends/autobuild.py Fri May 9 21:56:42 2008
@@ -69,11 +69,11 @@
pass
if i < ITERS-1:
if self.verbose_timeout:
- print >> sys.stderr, 'Server Error, retrying in %d seconds' % ((i+1)**2)
+ print >> sys.stderr, _('Server Error, retrying in %d seconds') % ((i+1)**2)
time.sleep((i+1)**2)
else:
if self.verbose_timeout:
- print >> sys.stderr, 'Server Error, aborting'
+ print >> sys.stderr, _('Server Error, aborting')
raise e
@@ -175,12 +175,12 @@
try:
p = subprocess.Popen(command, **kws)
except OSError, e:
- self.phasefp.write('<span class="error">Error: %s</span>\n' % escape(str(e)))
+ self.phasefp.write('<span class="error">' + _('Error: %s') % escape(str(e)) + '</span>\n')
raise CommandError(str(e))
cmds.pprint_output(p, format_line)
if p.returncode != 0:
- raise CommandError('Error running %s' % command, p.returncode)
+ raise CommandError(_('Error running %s') % command, p.returncode)
def start_build(self):
self.server = ServerProxy(self.xmlrpc_report_url, allow_none = True)
@@ -207,13 +207,13 @@
self.build_id = self.server.start_build(info)
except xmlrpclib.ProtocolError, e:
if e.errcode == 403:
- print >> sys.stderr, 'ERROR: Wrong credentials, please check username/password'
+ print >> sys.stderr, _('ERROR: Wrong credentials, please check username/password')
sys.exit(1)
raise
if self.verbose:
- s = 'Starting Build #%s' % self.build_id
+ s = _('Starting Build #%s') % self.build_id
print s
print '=' * len(s)
print ''
@@ -227,7 +227,7 @@
def start_module(self, module):
if self.verbose:
- print '\n%s**** Starting module %s ****%s' % (t_bold, module, t_reset)
+ print '\n%s' % t_bold + _('**** Starting module %s ****' % module) + t_reset
self.server.start_module(self.build_id, module)
self.current_module = module
self.modulefp = StringIO()
Modified: trunk/jhbuild/frontends/buildscript.py
==============================================================================
--- trunk/jhbuild/frontends/buildscript.py (original)
+++ trunk/jhbuild/frontends/buildscript.py Fri May 9 21:56:42 2008
@@ -37,23 +37,23 @@
try:
os.makedirs(self.config.checkoutroot)
except OSError:
- raise FatalError('checkout root can not be created')
+ raise FatalError(_('checkout root can not be created'))
if not os.access(self.config.checkoutroot, os.R_OK|os.W_OK|os.X_OK):
- raise FatalError('checkout root must be writable')
+ raise FatalError(_('checkout root must be writable'))
if not os.path.exists(self.config.prefix):
try:
os.makedirs(self.config.prefix)
except OSError:
- raise FatalError('install prefix can not be created')
+ raise FatalError(_('install prefix can not be created'))
if not os.access(self.config.prefix, os.R_OK|os.W_OK|os.X_OK):
- raise FatalError('install prefix must be writable')
+ raise FatalError(_('install prefix must be writable'))
packagedbdir = os.path.join(self.config.prefix, 'share', 'jhbuild')
try:
if not os.path.isdir(packagedbdir):
os.makedirs(packagedbdir)
except OSError:
- raise FatalError('could not create directory %s' % packagedbdir)
+ raise FatalError(_('could not create directory %s') % packagedbdir)
self.packagedb = packagedb.PackageDB(os.path.join(packagedbdir,
'packagedb.xml'))
@@ -77,7 +77,7 @@
if self.config.min_time is not None:
installdate = self.packagedb.installdate(module.name)
if installdate > self.config.min_time:
- self.message('Skipping %s (installed recently)' % module.name)
+ self.message(_('Skipping %s (installed recently)') % module.name)
continue
self.start_module(module.name)
@@ -85,11 +85,11 @@
for dep in module.dependencies:
if dep in failures:
if self.config.nopoison:
- self.message('module %s will be build even though %s failed' % (
- module.name, dep))
+ self.message(_('module %(mod)s will be build even though %(dep)s failed')
+ % { 'mod':module.name, 'dep':dep })
else:
- self.message('module %s not built due to non buildable %s'
- % (module.name, dep))
+ self.message(_('module %(mod)s not built due to non buildable %(dep)s')
+ % { 'mod':module.name, 'dep':dep })
failed = True
if failed:
failures.append(module.name)
Modified: trunk/jhbuild/frontends/gtkui.py
==============================================================================
--- trunk/jhbuild/frontends/gtkui.py (original)
+++ trunk/jhbuild/frontends/gtkui.py Fri May 9 21:56:42 2008
@@ -51,6 +51,9 @@
self.config = config
self.args = args
+ localedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../mo'))
+ gtk.glade.bindtextdomain('messages', localedir)
+
glade_filename = get_glade_filename()
# Fetch widgets out of the Glade
@@ -82,7 +85,7 @@
self.name_to_meta_module = {}
for possible_meta_module in full_module_list:
if isinstance(possible_meta_module, MetaModule):
- print "Found meta module %s" % possible_meta_module.name
+ print _("Found meta module %s") % possible_meta_module.name
self.meta_modules.append(possible_meta_module)
self.name_to_meta_module[possible_meta_module.name] = possible_meta_module
@@ -153,11 +156,11 @@
renderer = gtk.CellRendererToggle()
renderer.connect('toggled', self._meta_module_toggled, self.model)
- column = gtk.TreeViewColumn('Build', renderer, active=0)
+ column = gtk.TreeViewColumn(_('Build'), renderer, active=0)
column.set_clickable(True)
self.meta_modules_list.append_column(column)
- column = gtk.TreeViewColumn('Module Group', gtk.CellRendererText(), text=1)
+ column = gtk.TreeViewColumn(_('Module Group'), gtk.CellRendererText(), text=1)
self.meta_modules_list.append_column(column)
def _get_selected_meta_modules(self):
@@ -274,10 +277,11 @@
num_modules = len(self.modulelist)
if module_num > 0:
self.build_progress.set_fraction(module_num / float(num_modules))
- self.build_progress.set_text('%d of %d modules'
+ self.build_progress.set_text(_('%d of %d modules')
% (module_num, num_modules))
- self.window.set_title('[%d/%d] %s %s' % (module_num, num_modules, action, module.name))
+ self.window.set_title(_('[%(num)d/%(total)d] %(action)s %(module)s')
+ % { 'num':module_num, 'total':num_modules, 'action':action, 'module':module.name} )
self.current_status_label.set_text('%s %s' % (action, module.name))
def _runEventLoop(self):
@@ -369,9 +373,9 @@
self.window.show_all()
def end_build(self, failures):
if len(failures) == 0:
- self.message('success')
+ self.message(_('success'))
else:
- self.message('the following modules were not built:\n%s'
+ self.message(_('the following modules were not built:\n%s')
% ', '.join(failures))
def start_module(self, module):
# Remember where we are in case something fails
@@ -387,14 +391,15 @@
if not self.config.interact:
return 'fail'
- dialog = gtk.Dialog('Error during %s for module %s' % (state, module.name))
- dialog.add_button('_Try %s Again' % state, 1)
- dialog.add_button('_Ignore Error', 2)
- dialog.add_button('_Skip Module', 3)
- dialog.add_button('_Terminal', 4)
+ dialog = gtk.Dialog(_('Error during %(state)s for module %(module)s')
+ % {'state':state, 'module':module.name})
+ dialog.add_button(_('_Try %s Again') % state, 1)
+ dialog.add_button(_('_Ignore Error'), 2)
+ dialog.add_button(_('_Skip Module'), 3)
+ dialog.add_button(_('_Terminal'), 4)
for i, altstate in enumerate(altstates):
- dialog.add_button('Go to %s' % altstate, i + 5)
+ dialog.add_button(_('Go to %s') % altstate, i + 5)
text_view = gtk.TextView()
text_view.set_buffer(self.build_text)
Modified: trunk/jhbuild/frontends/terminal.py
==============================================================================
--- trunk/jhbuild/frontends/terminal.py (original)
+++ trunk/jhbuild/frontends/terminal.py Fri May 9 21:56:42 2008
@@ -132,7 +132,7 @@
def execute(self, command, hint=None, cwd=None, extra_env=None):
if not command:
- raise CommandError('No command given')
+ raise CommandError(_('No command given'))
kws = {
'close_fds': True
@@ -168,7 +168,7 @@
try:
p = subprocess.Popen(command, **kws)
except OSError, e:
- sys.stderr.write('Error: %s\n' % str(e))
+ sys.stderr.write(_('Error: %s\n') % str(e))
raise CommandError(str(e))
output = []
@@ -199,7 +199,7 @@
cmds.pprint_output(p, format_line)
if conflicts:
- sys.stdout.write('\nConflicts during checkout:\n')
+ sys.stdout.write(_('\nConflicts during checkout:\n'))
for line in conflicts:
sys.stdout.write('%s %s%s\n'
% (t_colour[12], line, t_reset))
@@ -221,7 +221,7 @@
if p.wait() != 0:
if self.config.quiet_mode:
print ''.join(output)
- raise CommandError('########## Error running %s' % pretty_command, p.returncode)
+ raise CommandError(_('########## Error running %s') % pretty_command, p.returncode)
def start_phase(self, module, state):
self.trayicon.set_icon(os.path.join(icondir,
@@ -230,16 +230,17 @@
def end_build(self, failures):
self.is_end_of_build = True
if len(failures) == 0:
- self.message('success')
+ self.message(_('success'))
else:
- self.message('the following modules were not built')
+ self.message(_('the following modules were not built'))
for module in failures:
print module,
print
def handle_error(self, module, state, nextstate, error, altstates):
'''handle error during build'''
- summary = 'error during stage %s of %s' % (state, module.name)
+ summary = _('error during stage %(stage)s of %(module)s') % {
+ 'stage':state, 'module':module.name}
self.message('%s: %s' % (summary, error))
self.trayicon.set_icon(os.path.join(icondir, 'error.png'))
self.notify.notify(summary = summary, body = error, icon = 'dialog-error', expire = 20)
@@ -253,15 +254,15 @@
return 'fail'
while True:
print
- print ' [1] rerun stage %s' % state
- print ' [2] ignore error and continue to %s' % nextstate
- print ' [3] give up on module'
- print ' [4] start shell'
+ print _(' [1] rerun stage %s') % state
+ print _(' [2] ignore error and continue to %s') % nextstate
+ print _(' [3] give up on module')
+ print _(' [4] start shell')
i = 5
for altstate in altstates:
- print ' [%d] go to stage %s' % (i, altstate)
+ print _(' [%d] go to stage %s') % (i, altstate)
i = i + 1
- val = raw_input('choice: ')
+ val = raw_input(_('choice: '))
val = val.strip()
if val == '1':
return state
@@ -274,14 +275,14 @@
os.chdir(module.get_builddir(self))
except OSError:
os.chdir(self.config.checkoutroot)
- print 'exit shell to continue with build'
+ print _('exit shell to continue with build')
os.system(user_shell)
else:
try:
val = int(val)
return altstates[val - 5]
except:
- print 'invalid choice'
+ print _('invalid choice')
assert False, 'not reached'
BUILD_SCRIPT = TerminalBuildScript
Modified: trunk/jhbuild/main.py
==============================================================================
--- trunk/jhbuild/main.py (original)
+++ trunk/jhbuild/main.py Fri May 9 21:56:42 2008
@@ -22,6 +22,12 @@
import optparse
import traceback
+import gettext
+localedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../mo'))
+gettext.install('messages', localedir=localedir, unicode=True, names=('gettext',))
+import __builtin__
+__builtin__.__dict__['N_'] = lambda x: x
+
import jhbuild.config
import jhbuild.commands
from jhbuild.errors import UsageError, FatalError
@@ -39,34 +45,33 @@
except ImportError:
pass
- print 'JHBuild commands are:'
- commands = [(x.name, x.__doc__) for x in jhbuild.commands.get_commands().values()]
+ print _('JHBuild commands are:')
+ commands = [(x.name, x.doc) for x in jhbuild.commands.get_commands().values()]
commands.sort()
for name, description in commands:
print ' %-15s %s' % (name, description)
print
- print 'For more information run "jhbuild <command> --help"'
+ print _('For more information run "jhbuild <command> --help"')
parser.exit()
def main(args):
parser = optparse.OptionParser(
- usage='%prog [ -f config ] command [ options ... ]',
- description='Build a set of modules from diverse repositories '\
- 'in correct dependency order (such as GNOME).')
+ usage=_('%prog [ -f config ] command [ options ... ]'),
+ description=_('Build a set of modules from diverse repositories in correct dependency order (such as GNOME).'))
parser.disable_interspersed_args()
parser.add_option('--help-commands', action='callback',
callback=help_commands,
- help='Information about available jhbuild commands')
+ help=_('Information about available jhbuild commands'))
parser.add_option('-f', '--file', action='store', metavar='CONFIG',
type='string', dest='configfile',
default=os.path.join(os.environ['HOME'], '.jhbuildrc'),
- help='use a non default configuration file')
+ help=_('use a non default configuration file'))
parser.add_option('-m', '--moduleset', action='store', metavar='URI',
type='string', dest='moduleset', default=None,
- help='use a non default module set')
+ help=_('use a non default module set'))
parser.add_option('--no-interact', action='store_true',
dest='nointeract', default=False,
- help='do not prompt for input')
+ help=_('do not prompt for input'))
options, args = parser.parse_args(args)
Modified: trunk/jhbuild/modtypes/__init__.py
==============================================================================
--- trunk/jhbuild/modtypes/__init__.py (original)
+++ trunk/jhbuild/modtypes/__init__.py Fri May 9 21:56:42 2008
@@ -51,7 +51,7 @@
except ImportError:
pass
if not _module_types.has_key(node.nodeName):
- raise FatalError('unknown module type %s' % node.nodeName)
+ raise FatalError(_('unknown module type %s') % node.nodeName)
parser = _module_types[node.nodeName]
return parser(node, config, uri, repositories, default_repo)
@@ -67,7 +67,7 @@
if dep.nodeType == dep.ELEMENT_NODE and dep.nodeName == 'dep':
package = dep.getAttribute('package')
if not package:
- raise FatalError('dep node for module %s is missing package attribute' % \
+ raise FatalError(_('dep node for module %s is missing package attribute') % \
node.getAttribute('id'))
list.append(package)
@@ -90,19 +90,21 @@
childnode.nodeName == 'branch'):
break
else:
- raise FatalError('no <branch> element found for %s' % name)
+ raise FatalError(_('no <branch> element found for %s') % name)
# look up the repository for this branch ...
if childnode.hasAttribute('repo'):
try:
repo = repositories[childnode.getAttribute('repo')]
except KeyError:
- raise FatalError('Repository=%s not found for module id=%s. Possible repositories are %s' % (childnode.getAttribute('repo'), name, repositories))
+ raise FatalError(_('Repository=%s not found for module id=%s. Possible repositories are %s' )
+ % (childnode.getAttribute('repo'), name, repositories))
else:
try:
repo = repositories[default_repo]
except KeyError:
- raise FatalError('Default Repository=%s not found for module id=%s. Possible repositories are %s' % (default_repo, name, repositories))
+ raise FatalError(_('Default Repository=%s not found for module id=%s. Possible repositories are %s')
+ % (default_repo, name, repositories))
return repo.branch_from_xml(name, childnode, repositories, default_repo)
@@ -191,7 +193,7 @@
# module has not been updated
if buildscript.config.build_policy == 'updated':
- buildscript.message('Skipping %s (not updated)' % self.name)
+ buildscript.message(_('Skipping %s (not updated)') % self.name)
return self.STATE_DONE
if buildscript.config.build_policy == 'updated-deps':
@@ -203,7 +205,7 @@
return None
else:
buildscript.message(
- 'Skipping %s (package and dependencies not updated)' % self.name)
+ _('Skipping %s (package and dependencies not updated)') % self.name)
return self.STATE_DONE
def checkout(self, buildscript):
@@ -212,7 +214,7 @@
self.branch.checkout(buildscript)
# did the checkout succeed?
if not os.path.exists(srcdir):
- raise BuildStateError('source directory %s was not created' % srcdir)
+ raise BuildStateError(_('source directory %s was not created') % srcdir)
if self.check_build_policy(buildscript) == self.STATE_DONE:
raise SkipToState(self.STATE_DONE)
Modified: trunk/jhbuild/modtypes/autotools.py
==============================================================================
--- trunk/jhbuild/modtypes/autotools.py (original)
+++ trunk/jhbuild/modtypes/autotools.py Fri May 9 21:56:42 2008
@@ -94,7 +94,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_CONFIGURE
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -126,7 +126,7 @@
builddir = self.get_builddir(buildscript)
if buildscript.config.buildroot and not os.path.exists(builddir):
os.makedirs(builddir)
- buildscript.set_action('Configuring', self)
+ buildscript.set_action(_('Configuring'), self)
if self.autogen_template:
template = self.autogen_template
@@ -184,7 +184,7 @@
buildscript.config.nobuild)
def do_clean(self, buildscript):
- buildscript.set_action('Cleaning', self)
+ buildscript.set_action(_('Cleaning'), self)
cmd = '%s %s clean' % (os.environ.get('MAKE', 'make'), self.makeargs)
buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
extra_env = self.extra_env)
@@ -195,7 +195,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
cmd = '%s %s' % (os.environ.get('MAKE', 'make'), self.makeargs)
buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
extra_env = self.extra_env)
@@ -208,7 +208,7 @@
buildscript.config.nobuild)
def do_check(self, buildscript):
- buildscript.set_action('Checking', self)
+ buildscript.set_action(_('Checking'), self)
cmd = '%s %s check' % (os.environ.get('MAKE', 'make'), self.makeargs)
try:
buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
@@ -223,7 +223,7 @@
return not (buildscript.config.makedist or buildscript.config.makedistcheck)
def do_dist(self, buildscript):
- buildscript.set_action('Creating tarball for', self)
+ buildscript.set_action(_('Creating tarball for'), self)
if buildscript.config.makedistcheck:
cmd = '%s %s distcheck' % (os.environ.get('MAKE', 'make'), self.makeargs)
else:
@@ -237,7 +237,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
if self.makeinstallargs:
cmd = '%s %s' % (os.environ.get('MAKE', 'make'), self.makeinstallargs)
else:
@@ -261,7 +261,7 @@
return False
def do_force_distclean(self, buildscript):
- buildscript.set_action('Distcleaning', self)
+ buildscript.set_action(_('Distcleaning'), self)
cmd = '%s %s distclean' % (os.environ.get('MAKE', 'make'), self.makeargs)
buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
extra_env = self.extra_env)
@@ -372,8 +372,8 @@
repo = repositories[node.getAttribute(attrname)]
break
except KeyError:
- raise FatalError('Repository=%s not found for module id=%s. '
- 'Possible repositories are %s'
+ raise FatalError(_('Repository=%s not found for module id=%s. '
+ 'Possible repositories are %s')
% (node.getAttribute(attrname),
node.getAttribute('id'), repositories))
else:
Modified: trunk/jhbuild/modtypes/cmake.py
==============================================================================
--- trunk/jhbuild/modtypes/cmake.py (original)
+++ trunk/jhbuild/modtypes/cmake.py Fri May 9 21:56:42 2008
@@ -71,7 +71,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_CONFIGURE
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -80,7 +80,7 @@
return buildscript.config.nobuild
def do_configure(self, buildscript):
- buildscript.set_action('Configuring', self)
+ buildscript.set_action(_('Configuring'), self)
srcdir = self.get_srcdir(buildscript)
builddir = self.get_builddir(buildscript)
if not os.path.exists(builddir):
@@ -95,7 +95,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
builddir = self.get_builddir(buildscript)
buildscript.execute(os.environ.get('MAKE', 'make'), cwd = builddir,
extra_env = self.extra_env)
@@ -106,7 +106,7 @@
return not buildscript.config.makedist
def do_dist(self, buildscript):
- buildscript.set_action('Creating tarball for', self)
+ buildscript.set_action(_('Creating tarball for'), self)
cmd = '%s package_source' % os.environ.get('MAKE', 'make')
buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
extra_env = self.extra_env)
@@ -117,7 +117,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
builddir = self.get_builddir(buildscript)
buildscript.execute([os.environ.get('MAKE', 'make'), 'install'],
cwd = builddir,
Modified: trunk/jhbuild/modtypes/distutils.py
==============================================================================
--- trunk/jhbuild/modtypes/distutils.py (original)
+++ trunk/jhbuild/modtypes/distutils.py Fri May 9 21:56:42 2008
@@ -72,7 +72,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_BUILD
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -81,7 +81,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
srcdir = self.get_srcdir(buildscript)
builddir = self.get_builddir(buildscript)
python = os.environ.get('PYTHON', 'python')
@@ -96,7 +96,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
srcdir = self.get_srcdir(buildscript)
builddir = self.get_builddir(buildscript)
python = os.environ.get('PYTHON', 'python')
Modified: trunk/jhbuild/modtypes/linux.py
==============================================================================
--- trunk/jhbuild/modtypes/linux.py (original)
+++ trunk/jhbuild/modtypes/linux.py Fri May 9 21:56:42 2008
@@ -72,12 +72,12 @@
return buildscript.config.nonetwork
def do_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.checkout(buildscript)
for kconfig in self.kconfigs:
kconfig.checkout(buildscript)
if not os.path.exists(kconfig.path):
- raise BuildStateError('kconfig file %s was not created' % kconfig.path)
+ raise BuildStateError(_('kconfig file %s was not created') % kconfig.path)
do_checkout.next_state = STATE_CONFIGURE
do_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -85,7 +85,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_CONFIGURE
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -94,7 +94,7 @@
return False
def do_configure(self, buildscript):
- buildscript.set_action('Configuring', self)
+ buildscript.set_action(_('Configuring'), self)
for kconfig in self.kconfigs:
shutil.copyfile(kconfig.path, os.path.join(self.branch.srcdir, ".config"))
@@ -123,7 +123,7 @@
buildscript.config.nobuild)
def do_clean(self, buildscript):
- buildscript.set_action('Cleaning', self)
+ buildscript.set_action(_('Cleaning'), self)
for kconfig in self.kconfigs:
cmd = '%s %s clean EXTRAVERSION=%s O=%s' % (
os.environ.get('MAKE', 'make'),
@@ -140,7 +140,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
for kconfig in self.kconfigs:
cmd = '%s %s EXTRAVERSION=%s O=%s' % (os.environ.get('MAKE', 'make'),
self.makeargs,
@@ -156,7 +156,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
for kconfig in self.kconfigs:
cmd = '%s %s install EXTRAVERSION=%s O=%s INSTALL_PATH=%s/boot' % (
os.environ.get('MAKE', 'make'),
@@ -174,7 +174,7 @@
return buildscript.config.nobuild
def do_modules_install(self, buildscript):
- buildscript.set_action('Installing modules', self)
+ buildscript.set_action(_('Installing modules'), self)
for kconfig in self.kconfigs:
cmd = '%s %s modules_install EXTRAVERSION=%s O=%s INSTALL_MOD_PATH=%s' % (
os.environ.get('MAKE', 'make'),
@@ -203,12 +203,12 @@
try:
repo = repositories[repo_name]
except KeyError:
- raise FatalError('Repository=%s not found for kconfig in linux id=%s. Possible repositories are %s' % (repo_name, id, repositories))
+ raise FatalError(_('Repository=%s not found for kconfig in linux id=%s. Possible repositories are %s') % (repo_name, id, repositories))
else:
try:
repo = repositories[default_repo]
except KeyError:
- raise FatalError('Default Repository=%s not found for kconfig in module id=%s. Possible repositories are %s' % (default_repo, id, repositories))
+ raise FatalError(_('Default Repository=%s not found for kconfig in module id=%s. Possible repositories are %s') % (default_repo, id, repositories))
kconfig = repo.branch_from_xml(id, childnode, repositories, default_repo)
@@ -222,7 +222,7 @@
kconfigs.append(kconfig)
if not kconfigs:
- raise FatalError('No <kconfig> elements found for module %s' % id)
+ raise FatalError(_('No <kconfig> elements found for module %s') % id)
return kconfigs
Modified: trunk/jhbuild/modtypes/mesa.py
==============================================================================
--- trunk/jhbuild/modtypes/mesa.py (original)
+++ trunk/jhbuild/modtypes/mesa.py Fri May 9 21:56:42 2008
@@ -86,7 +86,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_BUILD
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -95,7 +95,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
builddir = self.get_builddir(buildscript)
make = os.environ.get('MAKE', 'make')
if (os.path.exists(builddir + '/configs/current')):
@@ -111,7 +111,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
builddir = self.get_builddir(buildscript)
prefix = buildscript.config.prefix
Modified: trunk/jhbuild/modtypes/mozillamodule.py
==============================================================================
--- trunk/jhbuild/modtypes/mozillamodule.py (original)
+++ trunk/jhbuild/modtypes/mozillamodule.py Fri May 9 21:56:42 2008
@@ -69,10 +69,10 @@
if line[0] not in ('#', '\0', '\n'):
return line.strip()
else:
- raise FatalError('could not determine mozilla version')
+ raise FatalError(_('could not determine mozilla version'))
def checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
cmd = ['cvs', '-z3', '-q', '-d', self.repository.cvsroot, 'checkout']
if self.revision:
cmd.extend(['-r', self.revision])
@@ -95,7 +95,7 @@
cvs.check_sticky_tag(client_mk) != self.revision:
self.checkout(buildscript)
else:
- buildscript.set_action('Updating', self)
+ buildscript.set_action(_('Updating'), self)
make = os.environ.get('MAKE', 'make')
buildscript.execute([make, '-f', 'client.mk', 'fast-update'],
cwd = checkoutdir,
@@ -103,7 +103,7 @@
# did the checkout succeed?
if not os.path.exists(checkoutdir):
- raise BuildStateError('source directory %s was not created'
+ raise BuildStateError(_('source directory %s was not created')
% checkoutdir)
if self.check_build_policy(buildscript):
@@ -118,7 +118,7 @@
def do_configure(self, buildscript):
checkoutdir = self.get_builddir(buildscript)
- buildscript.set_action('Configuring', self)
+ buildscript.set_action(_('Configuring'), self)
if buildscript.config.use_lib64:
mozilla_path = '%s/lib64/%s-%s' \
% (buildscript.config.prefix,
@@ -144,7 +144,7 @@
do_configure.error_states = [AutogenModule.STATE_FORCE_CHECKOUT]
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
make = os.environ.get('MAKE', 'make')
cmd = '%s %s %s install' % (make, buildscript.config.makeargs,
self.makeargs)
Modified: trunk/jhbuild/modtypes/perl.py
==============================================================================
--- trunk/jhbuild/modtypes/perl.py (original)
+++ trunk/jhbuild/modtypes/perl.py Fri May 9 21:56:42 2008
@@ -68,7 +68,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_BUILD
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -77,7 +77,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
builddir = self.get_builddir(buildscript)
perl = os.environ.get('PERL', 'perl')
make = os.environ.get('MAKE', 'make')
@@ -92,7 +92,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
builddir = self.get_builddir(buildscript)
make = os.environ.get('MAKE', 'make')
buildscript.execute(
Modified: trunk/jhbuild/modtypes/waf.py
==============================================================================
--- trunk/jhbuild/modtypes/waf.py (original)
+++ trunk/jhbuild/modtypes/waf.py Fri May 9 21:56:42 2008
@@ -73,7 +73,7 @@
return False
def do_force_checkout(self, buildscript):
- buildscript.set_action('Checking out', self)
+ buildscript.set_action(_('Checking out'), self)
self.branch.force_checkout(buildscript)
do_force_checkout.next_state = STATE_CONFIGURE
do_force_checkout.error_states = [STATE_FORCE_CHECKOUT]
@@ -99,9 +99,9 @@
def do_configure(self, buildscript):
builddir = self.get_builddir(buildscript)
- buildscript.set_action('Configuring', self)
+ buildscript.set_action(_('Configuring'), self)
if not inpath(self.waf_cmd, os.environ['PATH'].split(os.pathsep)):
- raise CommandError('Missing waf, try jhbuild -m bootstrap buildone waf')
+ raise CommandError(_('Missing waf, try jhbuild -m bootstrap buildone waf'))
if buildscript.config.buildroot and not os.path.exists(builddir):
os.makedirs(builddir)
cmd = [self.waf_cmd, 'configure', '--prefix', buildscript.config.prefix]
@@ -116,7 +116,7 @@
buildscript.config.nobuild)
def do_clean(self, buildscript):
- buildscript.set_action('Cleaning', self)
+ buildscript.set_action(_('Cleaning'), self)
cmd = [self.waf_cmd, 'clean']
buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
do_clean.next_state = STATE_BUILD
@@ -126,7 +126,7 @@
return buildscript.config.nobuild
def do_build(self, buildscript):
- buildscript.set_action('Building', self)
+ buildscript.set_action(_('Building'), self)
cmd = [self.waf_cmd, 'build']
buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
do_build.next_state = STATE_CHECK
@@ -137,7 +137,7 @@
buildscript.config.nobuild)
def do_check(self, buildscript):
- buildscript.set_action('Checking', self)
+ buildscript.set_action(_('Checking'), self)
cmd = [self.waf_cmd, 'check']
try:
buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
@@ -151,7 +151,7 @@
return not (buildscript.config.makedist or buildscript.config.makedistcheck)
def do_dist(self, buildscript):
- buildscript.set_action('Creating tarball for', self)
+ buildscript.set_action(_('Creating tarball for'), self)
if buildscript.config.makedistcheck:
cmd = [self.waf_cmd, 'distcheck']
else:
@@ -164,7 +164,7 @@
return buildscript.config.nobuild
def do_install(self, buildscript):
- buildscript.set_action('Installing', self)
+ buildscript.set_action(_('Installing'), self)
cmd = [self.waf_cmd, 'install']
buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
buildscript.packagedb.add(self.name, self.get_revision() or '')
Modified: trunk/jhbuild/moduleset.py
==============================================================================
--- trunk/jhbuild/moduleset.py (original)
+++ trunk/jhbuild/moduleset.py Fri May 9 21:56:42 2008
@@ -28,7 +28,7 @@
try:
import xml.dom.minidom
except ImportError:
- raise FatalError('Python xml packages are required but could not be found')
+ raise FatalError(_('Python xml packages are required but could not be found'))
from jhbuild import modtypes
from jhbuild.versioncontrol import get_repo_type
@@ -52,7 +52,7 @@
try:
all_modules = [self.modules[mod] for mod in seed if mod not in skip]
except KeyError, e:
- raise UsageError('module "%s" not found' % str(e))
+ raise UsageError(_('module "%s" not found') % str(e))
asked_modules = all_modules[:]
@@ -64,7 +64,7 @@
for modname in all_modules[i].dependencies:
depmod = self.modules.get(modname)
if not depmod:
- raise UsageError('dependent module "%s" not found' % modname)
+ raise UsageError(_('dependent module "%s" not found') % modname)
if not depmod in all_modules:
all_modules.append(depmod)
@@ -168,7 +168,7 @@
try:
mod = self.modules[modname]
except KeyError:
- print >> sys.stderr, 'W: Unknown module:', modname
+ print >> sys.stderr, _('W: Unknown module:'), modname
del modules[0]
continue
if isinstance(mod, MetaModule):
@@ -251,12 +251,12 @@
try:
filename = httpcache.load(uri, nonetwork=config.nonetwork)
except Exception, e:
- raise FatalError('could not download %s: %s' % (uri, str(e)))
+ raise FatalError(_('could not download %s: %s') % (uri, str(e)))
filename = os.path.normpath(filename)
try:
document = xml.dom.minidom.parse(filename)
except xml.parsers.expat.ExpatError, e:
- raise FatalError('failed to parse %s: %s' % (filename, str(e)))
+ raise FatalError(_('failed to parse %s: %s') % (filename, str(e)))
assert document.documentElement.nodeName == 'moduleset'
moduleset = ModuleSet()
Modified: trunk/jhbuild/monkeypatch.py
==============================================================================
--- trunk/jhbuild/monkeypatch.py (original)
+++ trunk/jhbuild/monkeypatch.py Fri May 9 21:56:42 2008
@@ -141,12 +141,12 @@
else:
colno = i - len(''.join(lines[:-1]))
lineno = len(lines)
- raise ValueError('Invalid placeholder in string: line %d, col %d' %
+ raise ValueError(_('Invalid placeholder in string: line %d, col %d') %
(lineno, colno))
def substitute(self, *args, **kws):
if len(args) > 1:
- raise TypeError('Too many positional arguments')
+ raise TypeError(_('Too many positional arguments'))
if not args:
mapping = kws
elif kws:
@@ -166,13 +166,13 @@
return self.delimiter
if mo.group('invalid') is not None:
self._invalid(mo)
- raise ValueError('Unrecognized named group in pattern',
+ raise ValueError(_('Unrecognized named group in pattern'),
self.pattern)
return self.pattern.sub(convert, self.template)
def safe_substitute(self, *args, **kws):
if len(args) > 1:
- raise TypeError('Too many positional arguments')
+ raise TypeError(_('Too many positional arguments'))
if not args:
mapping = kws
elif kws:
@@ -199,7 +199,7 @@
return self.delimiter
if mo.group('invalid') is not None:
return self.delimiter
- raise ValueError('Unrecognized named group in pattern',
+ raise ValueError(_('Unrecognized named group in pattern'),
self.pattern)
return self.pattern.sub(convert, self.template)
Modified: trunk/jhbuild/utils/cmds.py
==============================================================================
--- trunk/jhbuild/utils/cmds.py (original)
+++ trunk/jhbuild/utils/cmds.py Fri May 9 21:56:42 2008
@@ -51,7 +51,7 @@
raise CommandError(str(e))
stdout, stderr = p.communicate()
if p.returncode != 0:
- raise CommandError('Error running %s' % cmd, p.returncode)
+ raise CommandError(_('Error running %s') % cmd, p.returncode)
return stdout
class Pipeline(subprocess.Popen):
Modified: trunk/jhbuild/utils/httpcache.py
==============================================================================
--- trunk/jhbuild/utils/httpcache.py (original)
+++ trunk/jhbuild/utils/httpcache.py Fri May 9 21:56:42 2008
@@ -42,7 +42,7 @@
try:
import xml.dom.minidom
except ImportError:
- raise SystemExit, 'Python xml packages are required but could not be found'
+ raise SystemExit, _('Python xml packages are required but could not be found')
def _parse_isotime(string):
if string[-1] != 'Z':
@@ -173,8 +173,7 @@
return os.path.join(self.cachedir, entry.local)
if nonetwork:
- raise RuntimeError('file not in cache, but not allowed '
- 'to check network')
+ raise RuntimeError(_('file not in cache, but not allowed to check network'))
request = urllib2.Request(uri)
if gzip:
Modified: trunk/jhbuild/utils/packagedb.py
==============================================================================
--- trunk/jhbuild/utils/packagedb.py (original)
+++ trunk/jhbuild/utils/packagedb.py Fri May 9 21:56:42 2008
@@ -21,7 +21,7 @@
try:
import xml.dom.minidom
except ImportError:
- raise SystemExit, 'Python xml packages are required but could not be found'
+ raise SystemExit, _('Python xml packages are required but could not be found')
def _parse_isotime(string):
if string[-1] != 'Z':
Modified: trunk/jhbuild/utils/unpack.py
==============================================================================
--- trunk/jhbuild/utils/unpack.py (original)
+++ trunk/jhbuild/utils/unpack.py Fri May 9 21:56:42 2008
@@ -102,6 +102,6 @@
elif zipfile.is_zipfile(localfile):
unpack_zip_file(localfile, target_directory)
else:
- raise CommandError('Failed to unpack %s (unknown archive type)' % localfile)
+ raise CommandError(_('Failed to unpack %s (unknown archive type)') % localfile)
except:
- raise CommandError('Failed to unpack %s' % localfile)
+ raise CommandError(_('Failed to unpack %s') % localfile)
Modified: trunk/jhbuild/versioncontrol/__init__.py
==============================================================================
--- trunk/jhbuild/versioncontrol/__init__.py (original)
+++ trunk/jhbuild/versioncontrol/__init__.py Fri May 9 21:56:42 2008
@@ -91,7 +91,7 @@
def force_checkout(self, buildscript):
"""A more agressive version of checkout()."""
- raise BuildStateError('force_checkout not implemented')
+ raise BuildStateError(_('force_checkout not implemented'))
def tree_id(self):
"""A string identifier for the state of the working tree."""
@@ -120,5 +120,5 @@
except ImportError:
pass
if name not in _repo_types:
- raise FatalError('unknown repository type %s' % name)
+ raise FatalError(_('unknown repository type %s') % name)
return _repo_types[name]
Modified: trunk/jhbuild/versioncontrol/arch.py
==============================================================================
--- trunk/jhbuild/versioncontrol/arch.py (original)
+++ trunk/jhbuild/versioncontrol/arch.py Fri May 9 21:56:42 2008
@@ -36,7 +36,7 @@
assert uri is not None, 'can not register archive without uri'
res = os.system('baz register-archive %s' % uri)
if res != 0:
- raise jhbuild.errors.FatalError('could not register archive %s'
+ raise jhbuild.errors.FatalError(_('could not register archive %s')
% archive)
def get_version(directory):
@@ -76,10 +76,10 @@
return
if self.href is None:
- raise BuildStateError('archive %s not registered' % self.href)
+ raise BuildStateError(_('archive %s not registered') % self.href)
res = os.system('baz register-archive %s' % self.href)
if res != 0:
- raise BuildStateError('could not register archive %s'
+ raise BuildStateError(_('could not register archive %s')
% self.archive)
branch_xml_attrs = ['module', 'checkoutdir']
@@ -88,7 +88,7 @@
if name in self.config.branches:
module = self.config.branches[name]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
else:
if module is None:
module = name
@@ -124,7 +124,7 @@
cmd.append(checkoutdir)
if date:
- raise BuildStageError('date based checkout not yet supported\n')
+ raise BuildStageError(_('date based checkout not yet supported\n'))
buildscript.execute(cmd, 'arch', cwd=self.checkoutroot)
@@ -137,7 +137,7 @@
self.repository._ensure_registered()
if date:
- raise BuildStageError('date based checkout not yet supported\n')
+ raise BuildStageError(_('date based checkout not yet supported\n'))
archive, version = split_name(self.module)
# how do you move a working copy to another branch?
Modified: trunk/jhbuild/versioncontrol/bzr.py
==============================================================================
--- trunk/jhbuild/versioncontrol/bzr.py (original)
+++ trunk/jhbuild/versioncontrol/bzr.py Fri May 9 21:56:42 2008
@@ -58,7 +58,7 @@
if name in self.config.branches:
module = self.config.branches[name]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
else:
if module is None:
module = name
@@ -87,13 +87,13 @@
cmd.append(self.checkoutdir)
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
buildscript.execute(cmd, 'bzr', cwd=self.checkoutroot)
def _update(self, buildscript, overwrite=False):
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
cmd = ['bzr', 'pull']
if overwrite:
cmd.append('--overwrite')
Modified: trunk/jhbuild/versioncontrol/cvs.py
==============================================================================
--- trunk/jhbuild/versioncontrol/cvs.py (original)
+++ trunk/jhbuild/versioncontrol/cvs.py Fri May 9 21:56:42 2008
@@ -96,7 +96,7 @@
else:
# call cvs login ..
if os.system('cvs -d %s login' % cvsroot) != 0:
- sys.stderr.write('could not log into %s\n' % cvsroot)
+ sys.stderr.write(_('could not log into %s\n') % cvsroot)
sys.exit(1)
def check_sticky_tag(filename):
@@ -114,7 +114,7 @@
else:
return parts[5][1:]
line = fp.readline()
- raise RuntimeError('%s is not managed by CVS' % filename)
+ raise RuntimeError(_('%s is not managed by CVS') % filename)
def check_root(dirname):
root_file = os.path.join(dirname, 'CVS', 'Root')
@@ -263,14 +263,12 @@
try:
wc_root = check_root(outputdir)
except IOError:
- raise BuildStateError('"%s" does not appear to be a CVS working '
- 'copy' % os.path.abspath(outputdir))
+ raise BuildStateError(_('"%s" does not appear to be a CVS working copy')
+ % os.path.abspath(outputdir))
if wc_root != self.repository.cvsroot:
- raise BuildStateError('working copy points at the wrong '
- 'repository (expected %s but got %s). '
- 'Consider using the changecvsroot.py '
- 'script to fix this.'
- % (self.repository.cvsroot, wc_root))
+ raise BuildStateError(_('working copy points at the wrong repository (expected %(root1)s but got %(root2)s). ')
+ % {'root1':self.repository.cvsroot, 'root2':wc_root} +
+ _('Consider using the changecvsroot.py script to fix this.'))
# update the working tree
cmd = ['cvs', '-z3', '-q', '-d', self.repository.cvsroot,
Modified: trunk/jhbuild/versioncontrol/darcs.py
==============================================================================
--- trunk/jhbuild/versioncontrol/darcs.py (original)
+++ trunk/jhbuild/versioncontrol/darcs.py Fri May 9 21:56:42 2008
@@ -48,7 +48,7 @@
if name in self.config.branches:
module = self.config.branches[name]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
else:
if module is None:
module = name
@@ -77,13 +77,13 @@
cmd.append(self.checkoutdir)
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
buildscript.execute(cmd, 'darcs', cwd=self.checkoutroot)
def _update(self, buildscript):
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
buildscript.execute(['darcs', 'pull', '-a', '--no-set-default', self.module],
'darcs', cwd=self.srcdir)
@@ -101,7 +101,7 @@
def checkout(self, buildscript):
if not inpath('darcs', os.environ['PATH'].split(os.pathsep)):
- raise CommandError('Missing darcs command')
+ raise CommandError(_('Missing darcs command'))
if os.path.exists(self.srcdir):
self._update(buildscript)
Modified: trunk/jhbuild/versioncontrol/git.py
==============================================================================
--- trunk/jhbuild/versioncontrol/git.py (original)
+++ trunk/jhbuild/versioncontrol/git.py Fri May 9 21:56:42 2008
@@ -70,7 +70,7 @@
if name in self.config.branches:
module = self.config.branches[name]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
else:
if module is None:
module = name
@@ -132,12 +132,12 @@
cwd=self.get_checkoutdir())
stdout = proc.communicate()[0]
if not stdout.strip():
- raise CommandError('Command %s returned no output' % cmd_desc)
+ raise CommandError(_('Command %s returned no output') % cmd_desc)
for line in stdout.splitlines():
if line.startswith('commit '):
commit = line.split(None, 1)[1].strip()
return commit
- raise CommandError('Command %s did not include commit line: %r'
+ raise CommandError(_('Command %s did not include commit line: %r')
% (cmd_desc, stdout))
def _export(self, buildscript):
@@ -252,7 +252,7 @@
def _checkout(self, buildscript, copydir=None):
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
cmd = ['git-svn', 'clone', self.module]
if self.checkoutdir:
@@ -264,7 +264,7 @@
if not self.revision:
cmd.extend(['-r', last_revision])
except KeyError:
- raise FatalError('Cannot get last revision from ' + self.module + '. Check the module location.')
+ raise FatalError(_('Cannot get last revision from %s. Check the module location.') % self.module)
if copydir:
buildscript.execute(cmd, 'git-svn', cwd=copydir)
@@ -283,7 +283,7 @@
def _update(self, buildscript, copydir=None):
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
cwd = self.get_checkoutdir()
@@ -337,7 +337,7 @@
def _update(self, buildscript, copydir=None):
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
# stash uncommitted changes on the current branch
cmd = ['git', 'stash', 'save', 'jhbuild-build']
Modified: trunk/jhbuild/versioncontrol/hg.py
==============================================================================
--- trunk/jhbuild/versioncontrol/hg.py (original)
+++ trunk/jhbuild/versioncontrol/hg.py Fri May 9 21:56:42 2008
@@ -49,7 +49,7 @@
if name in self.config.branches:
module = self.config.branches[name]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
else:
if module is None:
module = name
@@ -81,13 +81,13 @@
cmd.append(self.checkoutdir)
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
buildscript.execute(cmd, 'hg', cwd=self.checkoutroot)
def _update(self, buildscript):
if self.config.sticky_date:
- raise FatalError('date based checkout not yet supported\n')
+ raise FatalError(_('date based checkout not yet supported\n'))
hg_update = 'hg-update.py'
hg_update_path = os.path.join(os.path.dirname(__file__), '..',
'..', 'scripts', hg_update)
Modified: trunk/jhbuild/versioncontrol/mtn.py
==============================================================================
--- trunk/jhbuild/versioncontrol/mtn.py (original)
+++ trunk/jhbuild/versioncontrol/mtn.py Fri May 9 21:56:42 2008
@@ -48,7 +48,7 @@
if name in self.config.branches:
module = self.config.branches[module]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
if not branch:
branch = self.defbranch
@@ -87,7 +87,7 @@
def _init(self, buildscript):
"""Initializes the monotone database"""
- buildscript.message('Initializing %s' % (self.repository.database))
+ buildscript.message(_('Initializing %s') % (self.repository.database))
cmd = ['mtn', '-d', self.repository.database, 'db', 'init']
buildscript.execute(cmd, 'mtn')
@@ -95,8 +95,8 @@
def _pull(self, buildscript):
"""Pulls new revs into the database from the given server"""
- buildscript.message('Pulling branch %s from %s' %
- (self.branch, self.repository.server))
+ buildscript.message(_('Pulling branch %(branch)s from %(server)s') %
+ {'branch':self.branch, 'server':self.repository.server})
cmd = ['mtn', '-d', self.repository.database, 'pull',
self.repository.server, self.branch]
@@ -113,13 +113,14 @@
heads = len(output.splitlines())
if heads > 1:
- raise CommandError('branch %s has %d heads' % (self.branch, heads))
+ raise CommandError(_('branch %(branch)s has %(num)d heads') %
+ {'branch':self.branch, 'num':heads})
def _checkout(self, buildscript):
"""Checks out a branch from a repository."""
- buildscript.message('Checking out branch \'%s\' to directory \'%s\'' %
- (self.branch, self.srcdir))
+ buildscript.message(_('Checking out branch \'%(branch)s\' to directory \'%(dir)s\'') %
+ {'branch':self.branch, 'dir':self.srcdir})
cmd = ['mtn', '-d', self.repository.database, 'co', '-b', self.branch,
self._codir]
buildscript.execute(cmd, 'mtn')
@@ -127,7 +128,7 @@
def _update(self, buildscript):
"""Updates a monotone working directory."""
- buildscript.message('Updating working copy %s' % (self.srcdir))
+ buildscript.message(_('Updating working copy %s') % (self.srcdir))
cmd = ['mtn', 'up']
buildscript.execute(cmd, 'mtn', cwd=self._codir)
Modified: trunk/jhbuild/versioncontrol/svn.py
==============================================================================
--- trunk/jhbuild/versioncontrol/svn.py (original)
+++ trunk/jhbuild/versioncontrol/svn.py Fri May 9 21:56:42 2008
@@ -64,7 +64,7 @@
return ret
def get_subdirs(url):
- print "Getting SVN subdirs: this operation might be long..."
+ print _("Getting SVN subdirs: this operation might be long...")
output = get_output(
['svn', 'ls', '-R', url],
extra_env={
@@ -95,10 +95,10 @@
try:
info = get_info(filename)
except CommandError:
- raise BuildStateError('could not get Subversion URI for %s'
+ raise BuildStateError(_('could not get Subversion URI for %s')
% filename)
if 'url' not in info:
- raise BuildStateError('could not parse "svn info" output for %s'
+ raise BuildStateError(_('could not parse "svn info" output for %s')
% filename)
return info['url']
@@ -260,7 +260,7 @@
except OSError, e:
raise CommandError(str(e))
if '\nConflict' in output:
- raise CommandError('Error checking for conflicts')
+ raise CommandError(_('Error checking for conflicts'))
def checkout(self, buildscript):
if self.checkout_mode in ('clobber', 'export'):
Modified: trunk/jhbuild/versioncontrol/tarball.py
==============================================================================
--- trunk/jhbuild/versioncontrol/tarball.py (original)
+++ trunk/jhbuild/versioncontrol/tarball.py Fri May 9 21:56:42 2008
@@ -60,7 +60,7 @@
if name in self.config.branches:
module = self.config.branches[name]
if not module:
- raise FatalError('branch for %s has wrong override, check your .jhbuildrc' % name)
+ raise FatalError(_('branch for %s has wrong override, check your .jhbuildrc') % name)
else:
if module is None:
module = name
@@ -105,7 +105,7 @@
def _local_tarball(self):
basename = os.path.basename(self.module)
if not basename:
- raise FatalError('URL has no filename component: %s' % self.module)
+ raise FatalError(_('URL has no filename component: %s') % self.module)
localfile = os.path.join(self.config.tarballdir, basename)
return localfile
_local_tarball = property(_local_tarball)
@@ -138,13 +138,13 @@
"""Check whether the tarball has been downloaded correctly."""
localfile = self._local_tarball
if not os.path.exists(localfile):
- raise BuildStateError('file not downloaded')
+ raise BuildStateError(_('file not downloaded'))
if self.source_size is not None:
local_size = os.stat(localfile).st_size
if local_size != self.source_size:
- raise BuildStateError('downloaded file size is incorrect '
- '(expected %d, got %d)'
- % (self.source_size, local_size))
+ raise BuildStateError(
+ _('downloaded file size is incorrect (expected %(size1)d, got %(size2)d)')
+ % {'size1':self.source_size, 'size2':local_size})
if self.source_md5 is not None:
import md5
local_md5 = md5.new()
@@ -155,10 +155,8 @@
data = fp.read(32768)
fp.close()
if local_md5.hexdigest() != self.source_md5:
- raise BuildStateError('file MD5 sum is incorrect '
- '(expected %s, got %s)'
- % (self.source_md5,
- local_md5.hexdigest()))
+ raise BuildStateError(_('file MD5 sum is incorrect (expected %(sum1)s, got %(sum2)s)')
+ % {'sum1':self.source_md5, 'sum2':local_md5.hexdigest()})
def _download_and_unpack(self, buildscript):
localfile = self._local_tarball
@@ -175,7 +173,7 @@
res = buildscript.execute(
['curl', '-L', self.module, '-o', localfile])
else:
- raise FatalError("unable to find wget or curl")
+ raise FatalError(_("unable to find wget or curl"))
self._check_tarball()
@@ -183,10 +181,10 @@
try:
unpack_archive(buildscript, localfile, self.checkoutroot)
except CommandError:
- raise FatalError('failed to unpack %s' % localfile)
+ raise FatalError(_('failed to unpack %s') % localfile)
if not os.path.exists(self.srcdir):
- raise BuildStateError('could not unpack tarball')
+ raise BuildStateError(_('could not unpack tarball'))
if self.patches:
self._do_patches(buildscript)
@@ -200,9 +198,9 @@
try:
patchfile = httpcache.load(patch, nonetwork=buildscript.config.nonetwork)
except urllib2.HTTPError, e:
- raise BuildStateError('could not download patch (error: %s)' % e.code)
+ raise BuildStateError(_('could not download patch (error: %s)') % e.code)
except urllib2.URLError, e:
- raise BuildStateError('could not download patch')
+ raise BuildStateError(_('could not download patch'))
elif self.repository.moduleset_uri:
# get it relative to the moduleset uri, either in the same
# directory or a patches/ subdirectory
@@ -223,14 +221,14 @@
# nothing else, use jbuild provided patches
patchfile = os.path.join(jhbuild_directory, 'patches', patch)
- buildscript.set_action('Applying patch', self, action_target=patch)
+ buildscript.set_action(_('Applying patch'), self, action_target=patch)
buildscript.execute('patch -p%d < "%s"'
% (patchstrip, patchfile),
cwd=self.srcdir)
def _quilt_checkout(self, buildscript):
if not has_command('quilt'):
- raise FatalError("unable to find quilt")
+ raise FatalError(_("unable to find quilt"))
if os.path.exists(self.quilt.srcdir) and \
os.path.exists(os.path.join(self.srcdir, '.pc/applied-patches')):
@@ -241,7 +239,7 @@
self.quilt.checkout(buildscript)
if not os.path.exists(self.quilt.srcdir):
- raise FatalError('could not checkout quilt patch set')
+ raise FatalError(_('could not checkout quilt patch set'))
buildscript.execute('quilt push -a',
cwd=self.srcdir,
Added: trunk/po/LINGUAS
==============================================================================
--- (empty file)
+++ trunk/po/LINGUAS Fri May 9 21:56:42 2008
@@ -0,0 +1 @@
+fr
Added: trunk/po/Makevars
==============================================================================
--- (empty file)
+++ trunk/po/Makevars Fri May 9 21:56:42 2008
@@ -0,0 +1,4 @@
+top_builddir=..
+top_srcdir=..
+
+DOMAIN=jhbuild
Added: trunk/po/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.in Fri May 9 21:56:42 2008
@@ -0,0 +1,43 @@
+jhbuild/commands/autobuild.py
+jhbuild/commands/base.py
+jhbuild/commands/bootstrap.py
+jhbuild/commands/checkbranches.py
+jhbuild/commands/gui.py
+jhbuild/commands/info.py
+jhbuild/commands/__init__.py
+jhbuild/commands/rdepends.py
+jhbuild/commands/sanitycheck.py
+jhbuild/commands/tinderbox.py
+jhbuild/cut_n_paste/optparse.py
+jhbuild/frontends/autobuild.py
+jhbuild/frontends/buildscript.py
+jhbuild/frontends/gtkui.py
+jhbuild/frontends/jhbuild.glade
+jhbuild/frontends/terminal.py
+jhbuild/modtypes/autotools.py
+jhbuild/modtypes/cmake.py
+jhbuild/modtypes/distutils.py
+jhbuild/modtypes/__init__.py
+jhbuild/modtypes/linux.py
+jhbuild/modtypes/mesa.py
+jhbuild/modtypes/mozillamodule.py
+jhbuild/modtypes/perl.py
+jhbuild/modtypes/waf.py
+jhbuild/utils/cmds.py
+jhbuild/utils/httpcache.py
+jhbuild/utils/packagedb.py
+jhbuild/utils/unpack.py
+jhbuild/versioncontrol/arch.py
+jhbuild/versioncontrol/bzr.py
+jhbuild/versioncontrol/cvs.py
+jhbuild/versioncontrol/darcs.py
+jhbuild/versioncontrol/git.py
+jhbuild/versioncontrol/hg.py
+jhbuild/versioncontrol/__init__.py
+jhbuild/versioncontrol/mtn.py
+jhbuild/versioncontrol/svn.py
+jhbuild/versioncontrol/tarball.py
+jhbuild/config.py
+jhbuild/main.py
+jhbuild/moduleset.py
+jhbuild/monkeypatch.py
Modified: trunk/tests/tests.py
==============================================================================
--- trunk/tests/tests.py (original)
+++ trunk/tests/tests.py Fri May 9 21:56:42 2008
@@ -27,6 +27,10 @@
import tempfile
import unittest
+import __builtin__
+__builtin__.__dict__['_'] = lambda x: x
+__builtin__.__dict__['N_'] = lambda x: x
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from jhbuild.errors import DependencyCycleError, UsageError, CommandError
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]