本文整理汇总了Python中waflib.Utils.h_list方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.h_list方法的具体用法?Python Utils.h_list怎么用?Python Utils.h_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Utils
的用法示例。
在下文中一共展示了Utils.h_list方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hash_env_vars
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def hash_env_vars(self,env,vars_lst):
if not env.table:
env=env.parent
if not env:
return Utils.SIG_NIL
idx=str(id(env))+str(vars_lst)
try:
cache=self.cache_env
except AttributeError:
cache=self.cache_env={}
else:
try:
return self.cache_env[idx]
except KeyError:
pass
lst=[env[a]for a in vars_lst]
ret=Utils.h_list(lst)
Logs.debug('envhash: %s %r',Utils.to_hex(ret),lst)
cache[idx]=ret
return ret
示例2: apply_subst
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def apply_subst(self):
Utils.def_attrs(self, fun=subst_func)
lst = self.to_list(self.source)
self.meths.remove('process_source')
self.dict = getattr(self, 'dict', {})
for filename in lst:
node = self.path.find_resource(filename)
if not node: raise Errors.WafError('cannot find input file %s for processing' % filename)
if self.target:
newnode = self.path.find_or_declare(self.target)
else:
newnode = node.change_ext('')
try:
self.dict = self.dict.get_merged_dict()
except AttributeError:
pass
if self.dict and not self.env['DICT_HASH']:
self.env = self.env.derive()
keys = list(self.dict.keys())
keys.sort()
lst = [self.dict[x] for x in keys]
self.env['DICT_HASH'] = str(Utils.h_list(lst))
tsk = self.create_task('copy', node, newnode)
tsk.fun = self.fun
tsk.dict = self.dict
tsk.dep_vars = ['DICT_HASH']
tsk.chmod = getattr(self, 'chmod', Utils.O644)
if not tsk.env:
tsk.debug()
raise Errors.WafError('task without an environment')
####################
## command-output ####
####################
示例3: post_recurse
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def post_recurse(self,node):
super(ConfigurationContext,self).post_recurse(node)
self.hash=Utils.h_list((self.hash,node.read('rb')))
self.files.append(node.abspath())
示例4: hash_aux_nodes
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def hash_aux_nodes(self):
try:
nodes=self.aux_nodes
except AttributeError:
try:
self.aux_nodes=self.scan_aux(self.inputs[0].change_ext('.aux'))
except IOError:
return None
return Utils.h_list([Utils.h_file(x.abspath())for x in self.aux_nodes])
示例5: autoconfigure
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def autoconfigure(execute_method):
def execute(self):
if not Configure.autoconfig:
return execute_method(self)
env=ConfigSet.ConfigSet()
do_config=False
try:
env.load(os.path.join(Context.top_dir,Options.lockfile))
except Exception:
Logs.warn('Configuring the project')
do_config=True
else:
if env.run_dir!=Context.run_dir:
do_config=True
else:
h=0
for f in env['files']:
h=Utils.h_list((h,Utils.readf(f,'rb')))
do_config=h!=env.hash
if do_config:
Options.commands.insert(0,self.cmd)
Options.commands.insert(0,'configure')
if Configure.autoconfig=='clobber':
Options.options.__dict__=env.options
return
return execute_method(self)
return execute
示例6: sig_vars
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def sig_vars(self):
bld=self.generator.bld
env=self.env
upd=self.m.update
if getattr(self.generator,'fun',None):
upd(Utils.h_fun(self.generator.fun))
if getattr(self.generator,'subst_fun',None):
upd(Utils.h_fun(self.generator.subst_fun))
vars=self.generator.bld.raw_deps.get(self.uid(),[])
act_sig=bld.hash_env_vars(env,vars)
upd(act_sig)
lst=[getattr(self.generator,x,'')for x in vars]
upd(Utils.h_list(lst))
return self.m.digest()
示例7: hash_aux_nodes
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def hash_aux_nodes(self):
try:
self.aux_nodes
except AttributeError:
try:
self.aux_nodes=self.scan_aux(self.inputs[0].change_ext('.aux'))
except IOError:
return None
return Utils.h_list([Utils.h_file(x.abspath())for x in self.aux_nodes])
示例8: run_build
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_list [as 别名]
def run_build(self,*k,**kw):
lst=[str(v)for(p,v)in kw.items()if p!='env']
h=Utils.h_list(lst)
dir=self.bldnode.abspath()+os.sep+(not Utils.is_win32 and'.'or'')+'conf_check_'+Utils.to_hex(h)
try:
os.makedirs(dir)
except OSError:
pass
try:
os.stat(dir)
except OSError:
self.fatal('cannot use the configuration test folder %r'%dir)
cachemode=getattr(Options.options,'confcache',None)
if cachemode==1:
try:
proj=ConfigSet.ConfigSet(os.path.join(dir,'cache_run_build'))
except OSError:
pass
except IOError:
pass
else:
ret=proj['cache_run_build']
if isinstance(ret,str)and ret.startswith('Test does not build'):
self.fatal(ret)
return ret
bdir=os.path.join(dir,'testbuild')
if not os.path.exists(bdir):
os.makedirs(bdir)
self.test_bld=bld=Build.BuildContext(top_dir=dir,out_dir=bdir)
bld.init_dirs()
bld.progress_bar=0
bld.targets='*'
bld.logger=self.logger
bld.all_envs.update(self.all_envs)
bld.env=kw['env']
bld.kw=kw
bld.conf=self
kw['build_fun'](bld)
ret=-1
try:
try:
bld.compile()
except Errors.WafError:
ret='Test does not build: %s'%Utils.ex_stack()
self.fatal(ret)
else:
ret=getattr(bld,'retval',0)
finally:
if cachemode==1:
proj=ConfigSet.ConfigSet()
proj['cache_run_build']=ret
proj.store(os.path.join(dir,'cache_run_build'))
else:
shutil.rmtree(dir)
return ret