本文整理匯總了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