本文整理汇总了Python中waflib.Context.launch_dir方法的典型用法代码示例。如果您正苦于以下问题:Python Context.launch_dir方法的具体用法?Python Context.launch_dir怎么用?Python Context.launch_dir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Context
的用法示例。
在下文中一共展示了Context.launch_dir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: find_program
# 需要导入模块: from waflib import Context [as 别名]
# 或者: from waflib.Context import launch_dir [as 别名]
def find_program(program_name, env):
launch_dir = os.path.abspath(Context.launch_dir)
#top_dir = os.path.abspath(Options.cwd_launch)
found_programs = []
for obj in bld.all_task_gen:
if not getattr(obj, 'is_ns3_program', False):
continue
## filter out programs not in the subtree starting at the launch dir
if not (obj.path.abspath().startswith(launch_dir)
or obj.path.abspath(env).startswith(launch_dir)):
continue
name1 = obj.target
name2 = os.path.join(relpath(obj.path.abspath(), launch_dir), obj.target)
names = [name1, name2]
found_programs.extend(names)
if program_name in names:
return obj
raise ValueError("program '%s' not found; available programs are: %r"
% (program_name, found_programs))
示例2: find_program
# 需要导入模块: from waflib import Context [as 别名]
# 或者: from waflib.Context import launch_dir [as 别名]
def find_program(program_name, env):
launch_dir = os.path.abspath(Context.launch_dir)
#top_dir = os.path.abspath(Options.cwd_launch)
found_programs = []
for obj in bld.all_task_gen:
if not getattr(obj, 'is_ns3_program', False):
continue
## filter out programs not in the subtree starting at the launch dir
if not (obj.path.abspath().startswith(launch_dir)
or obj.path.get_bld().abspath().startswith(launch_dir)):
continue
name1 = obj.name
name2 = os.path.join(relpath(obj.path.abspath(), launch_dir), obj.name)
names = [name1, name2]
found_programs.extend(names)
if program_name in names:
return obj
raise ValueError("program '%s' not found; available programs are: %r"
% (program_name, found_programs))
示例3: __init__
# 需要导入模块: from waflib import Context [as 别名]
# 或者: from waflib.Context import launch_dir [as 别名]
def __init__(self,**kw):
super(BuildContext,self).__init__(**kw)
self.is_install=0
self.top_dir=kw.get('top_dir',Context.top_dir)
self.run_dir=kw.get('run_dir',Context.run_dir)
self.post_mode=POST_AT_ONCE
self.out_dir=kw.get('out_dir',Context.out_dir)
self.cache_dir=kw.get('cache_dir',None)
if not self.cache_dir:
self.cache_dir=os.path.join(self.out_dir,CACHE_DIR)
self.all_envs={}
self.task_sigs={}
self.node_deps={}
self.raw_deps={}
self.cache_dir_contents={}
self.task_gen_cache_names={}
self.launch_dir=Context.launch_dir
self.jobs=Options.options.jobs
self.targets=Options.options.targets
self.keep=Options.options.keep
self.progress_bar=Options.options.progress_bar
self.deps_man=Utils.defaultdict(list)
self.current_group=0
self.groups=[]
self.group_names={}
示例4: load_module
# 需要导入模块: from waflib import Context [as 别名]
# 或者: from waflib.Context import launch_dir [as 别名]
def load_module(path,encoding=None):
ret=rev(path,encoding)
if'set_options'in ret.__dict__:
if Logs.verbose:
Logs.warn('compat: rename "set_options" to "options" (%r)'%path)
ret.options=ret.set_options
if'srcdir'in ret.__dict__:
if Logs.verbose:
Logs.warn('compat: rename "srcdir" to "top" (%r)'%path)
ret.top=ret.srcdir
if'blddir'in ret.__dict__:
if Logs.verbose:
Logs.warn('compat: rename "blddir" to "out" (%r)'%path)
ret.out=ret.blddir
Utils.g_module=Context.g_module
Options.launch_dir=Context.launch_dir
return ret
示例5: launch_node
# 需要导入模块: from waflib import Context [as 别名]
# 或者: from waflib.Context import launch_dir [as 别名]
def launch_node(self):
try:
return self.p_ln
except AttributeError:
self.p_ln=self.root.find_dir(self.launch_dir)
return self.p_ln