diff options
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r-- | src/engine/SCons/Tool/xgettext.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/engine/SCons/Tool/xgettext.py b/src/engine/SCons/Tool/xgettext.py index f9375a2..923fd17 100644 --- a/src/engine/SCons/Tool/xgettext.py +++ b/src/engine/SCons/Tool/xgettext.py @@ -1,10 +1,10 @@ -""" xgettext tool +""" xgettext tool Tool specific initialization of `xgettext` tool. """ # __COPYRIGHT__ -# +# # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including @@ -12,10 +12,10 @@ Tool specific initialization of `xgettext` tool. # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: -# +# # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -23,7 +23,7 @@ Tool specific initialization of `xgettext` tool. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -from six import u +from SCons.compat.six import u __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -40,12 +40,12 @@ class _CmdRunner(object): self.command = command self.commandstr = commandstr - def __call__(self, target, source, env): + def __call__(self, target, source, env): import SCons.Action import subprocess import os import sys - kw = { + kw = { 'stdin' : 'devnull', 'stdout' : subprocess.PIPE, 'stderr' : subprocess.PIPE, @@ -105,9 +105,9 @@ def _update_pot_file(target, source, env): os.chdir(save_os_cwd) # If the command was not successfull, return error code. if status: return status - + new_content = cmd.out - + if not new_content: # When xgettext finds no internationalized messages, no *.pot is created # (because we don't want to bother translators with empty POT files). @@ -145,7 +145,7 @@ def _update_pot_file(target, source, env): # Print message employing SCons.Action.Action for that. msg = "Not writting " + repr(str(target[0])) + " (" + explain + ")" env.Execute(SCons.Action.Action(nop, msg)) - return 0 + return 0 ############################################################################# ############################################################################# @@ -208,7 +208,7 @@ def _scan_xgettext_from_files(target, source, env, files = None, path = None): contents = re_emptyln.sub("", contents) contents = re_trailws.sub("", contents) depnames = contents.splitlines() - for depname in depnames: + for depname in depnames: depfile = SCons.Node.FS.find_file(depname, dirs) if not depfile: depfile = env.arg2nodes(depname, dirs[0].File) @@ -223,7 +223,7 @@ def _pot_update_emitter(target, source, env): import SCons.Util import SCons.Node.FS - if 'XGETTEXTFROM' in env: + if 'XGETTEXTFROM' in env: xfrom = env['XGETTEXTFROM'] else: return target, source @@ -231,13 +231,13 @@ def _pot_update_emitter(target, source, env): xfrom = [ xfrom ] xfrom = SCons.Util.flatten(xfrom) - + # Prepare list of 'POTFILE.in' files. files = [] for xf in xfrom: if not isinstance(xf, SCons.Node.FS.Base): if SCons.Util.is_String(xf): - # Interpolate variables in strings + # Interpolate variables in strings xf = env.subst(xf, source = source, target = target) xf = env.arg2nodes(xf) files.extend(xf) @@ -275,7 +275,7 @@ def generate(env,**kw): try: env['XGETTEXT'] = _detect_xgettext(env) except: - env['XGETTEXT'] = 'xgettext' + env['XGETTEXT'] = 'xgettext' # NOTE: sources="$SOURCES" would work as well. However, we use following # construction to convert absolute paths provided by scons onto paths # relative to current working dir. Note, that scons expands $SOURCE(S) to |