本文整理汇总了Python中SCons.Builder.BuilderBase._execute方法的典型用法代码示例。如果您正苦于以下问题:Python BuilderBase._execute方法的具体用法?Python BuilderBase._execute怎么用?Python BuilderBase._execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCons.Builder.BuilderBase
的用法示例。
在下文中一共展示了BuilderBase._execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _execute
# 需要导入模块: from SCons.Builder import BuilderBase [as 别名]
# 或者: from SCons.Builder.BuilderBase import _execute [as 别名]
def _execute(self, env, target, source, *args):
if not target:
if env.has_key('POTDOMAIN') and env['POTDOMAIN']:
domain = env['POTDOMAIN']
else:
domain = 'messages'
target = [ domain ]
return BuilderBase._execute(self, env, target, source, *args)
示例2: _execute
# 需要导入模块: from SCons.Builder import BuilderBase [as 别名]
# 或者: from SCons.Builder.BuilderBase import _execute [as 别名]
def _execute(self, env, target, source, *args):
if not target:
if env.has_key("POTDOMAIN") and env["POTDOMAIN"]:
domain = env["POTDOMAIN"]
else:
domain = "messages"
target = [domain]
return BuilderBase._execute(self, env, target, source, *args)
示例3: _execute
# 需要导入模块: from SCons.Builder import BuilderBase [as 别名]
# 或者: from SCons.Builder.BuilderBase import _execute [as 别名]
def _execute(self, env, target, source, *args, **kw):
""" Execute builder's actions.
Here we append to `target` the languages read from `$LINGUAS_FILE` and
apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.
The arguments and return value are same as for
`SCons.Builder.BuilderBase._execute()`.
"""
import SCons.Util
import SCons.Node
linguas_files = None
if env.has_key("LINGUAS_FILE") and env["LINGUAS_FILE"]:
linguas_files = env["LINGUAS_FILE"]
# This prevents endless recursion loop (we'll be invoked once for
# each target appended here, we must not extend the list again).
env["LINGUAS_FILE"] = None
linguas = _read_linguas_from_files(env, linguas_files)
if SCons.Util.is_List(target):
target.extend(linguas)
elif target is not None:
target = [target] + linguas
else:
target = linguas
if not target:
# Let the SCons.BuilderBase to handle this patologic situation
return BuilderBase._execute(self, env, target, source, *args, **kw)
# The rest is ours
if not SCons.Util.is_List(target):
target = [target]
result = []
for tgt in target:
r = BuilderBase._execute(self, env, [tgt], source, *args, **kw)
result.extend(r)
if linguas_files is not None:
env["LINGUAS_FILE"] = linguas_files
return SCons.Node.NodeList(result)
示例4: _execute
# 需要导入模块: from SCons.Builder import BuilderBase [as 别名]
# 或者: from SCons.Builder.BuilderBase import _execute [as 别名]
def _execute(self, env, target, source, *args, **kw):
# Here we add support for 'LINGUAS_FILE' keyword. Emitter is not suitable
# in this case, as it is called too late (after multiple sources
# are handled single_source builder.
import SCons.Util
from SCons.Tool.GettextCommon import _read_linguas_from_files
linguas_files = None
if env.has_key('LINGUAS_FILE') and env['LINGUAS_FILE'] is not None:
linguas_files = env['LINGUAS_FILE']
# This should prevent from endless recursion.
env['LINGUAS_FILE'] = None
# We read only languages. Suffixes shall be added automatically.
linguas = _read_linguas_from_files(env, linguas_files)
if SCons.Util.is_List(source):
source.extend(linguas)
elif source is not None:
source = [source] + linguas
else:
source = linguas
result = BuilderBase._execute(self,env,target,source,*args, **kw)
if linguas_files is not None:
env['LINGUAS_FILE'] = linguas_files
return result
示例5: _execute
# 需要导入模块: from SCons.Builder import BuilderBase [as 别名]
# 或者: from SCons.Builder.BuilderBase import _execute [as 别名]
def _execute(self, env, target, source, ow={}, exec_kw={}):
"""
Override _execute() to remove C header files from the sources list
"""
sources = BuilderBase._execute(self, env, target,source, ow, exec_kw)
return [x for x in sources if is_c_file(x)]