本文整理匯總了Python中waflib.Logs.debug方法的典型用法代碼示例。如果您正苦於以下問題:Python Logs.debug方法的具體用法?Python Logs.debug怎麽用?Python Logs.debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類waflib.Logs
的用法示例。
在下文中一共展示了Logs.debug方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: runnable_status
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def runnable_status(self):
for t in self.run_after:
if not t.hasrun:
return ASK_LATER
bld=self.generator.bld
try:
new_sig=self.signature()
except Errors.TaskNotReady:
return ASK_LATER
key=self.uid()
try:
prev_sig=bld.task_sigs[key]
except KeyError:
Logs.debug("task: task %r must run as it was never run before or the task code changed"%self)
return RUN_ME
for node in self.outputs:
try:
if node.sig!=new_sig:
return RUN_ME
except AttributeError:
Logs.debug("task: task %r must run as the output nodes do not exist"%self)
return RUN_ME
if new_sig!=prev_sig:
return RUN_ME
return SKIP_ME
示例2: configure
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def configure(conf):
try:test_for_compiler=conf.options.check_d_compiler or default_compilers()
except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_d')")
for compiler in re.split('[ ,]+',test_for_compiler):
conf.env.stash()
conf.start_msg('Checking for %r (D compiler)'%compiler)
try:
conf.load(compiler)
except conf.errors.ConfigurationError ,e:
conf.env.revert()
conf.end_msg(False)
Logs.debug('compiler_d: %r'%e)
else:
if conf.env.D:
conf.end_msg(conf.env.get_flat('D'))
conf.env['COMPILER_D']=compiler
break
conf.end_msg(False)
示例3: configure
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def configure(conf):
try:test_for_compiler=conf.options.check_fortran_compiler or default_compilers()
except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_fc')")
for compiler in re.split('[ ,]+',test_for_compiler):
conf.env.stash()
conf.start_msg('Checking for %r (Fortran compiler)'%compiler)
try:
conf.load(compiler)
except conf.errors.ConfigurationError ,e:
conf.env.revert()
conf.end_msg(False)
Logs.debug('compiler_fortran: %r'%e)
else:
if conf.env['FC']:
conf.end_msg(conf.env.get_flat('FC'))
conf.env.COMPILER_FORTRAN=compiler
break
conf.end_msg(False)
示例4: bibunitscan
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def bibunitscan(self):
node=self.inputs[0]
nodes=[]
if not node:return nodes
code=node.read()
for match in re_bibunit.finditer(code):
path=match.group('file')
if path:
for k in('','.bib'):
Logs.debug('tex: trying %s%s'%(path,k))
fi=node.parent.find_resource(path+k)
if fi:
nodes.append(fi)
else:
Logs.debug('tex: could not find %s'%path)
Logs.debug("tex: found the following bibunit files: %s"%nodes)
return nodes
示例5: apply_flags_msvc
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def apply_flags_msvc(self):
if self.env.CC_NAME!='msvc'or not getattr(self,'link_task',None):
return
is_static=isinstance(self.link_task,ccroot.stlink_task)
subsystem=getattr(self,'subsystem','')
if subsystem:
subsystem='/subsystem:%s'%subsystem
flags=is_static and'ARFLAGS'or'LINKFLAGS'
self.env.append_value(flags,subsystem)
if not is_static:
for f in self.env.LINKFLAGS:
d=f.lower()
if d[1:]=='debug':
pdbnode=self.link_task.outputs[0].change_ext('.pdb')
self.link_task.outputs.append(pdbnode)
if getattr(self,'install_task',None):
self.pdb_install_task=self.bld.install_files(self.install_task.dest,pdbnode,env=self.env)
break
示例6: exec_mf
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def exec_mf(self):
env=self.env
mtool=env['MT']
if not mtool:
return 0
self.do_manifest=False
outfile=self.outputs[0].abspath()
manifest=None
for out_node in self.outputs:
if out_node.name.endswith('.manifest'):
manifest=out_node.abspath()
break
if manifest is None:
return 0
mode=''
if'cprogram'in self.generator.features or'cxxprogram'in self.generator.features:
mode='1'
elif'cshlib'in self.generator.features or'cxxshlib'in self.generator.features:
mode='2'
debug('msvc: embedding manifest in mode %r'%mode)
lst=[]+mtool
lst.extend(Utils.to_list(env['MTFLAGS']))
lst.extend(['-manifest',manifest])
lst.append('-outputresource:%s;%s'%(outfile,mode))
return self.exec_command(lst)
示例7: exec_command
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def exec_command(self,cmd,**kw):
subprocess=Utils.subprocess
kw['shell']=isinstance(cmd,str)
Logs.debug('runner: %r'%(cmd,))
Logs.debug('runner_env: kw=%s'%kw)
if self.logger:
self.logger.info(cmd)
if'stdout'not in kw:
kw['stdout']=subprocess.PIPE
if'stderr'not in kw:
kw['stderr']=subprocess.PIPE
if Logs.verbose and not kw['shell']and not Utils.check_exe(cmd[0]):
raise Errors.WafError("Program %s not found!"%cmd[0])
try:
if kw['stdout']or kw['stderr']:
p=subprocess.Popen(cmd,**kw)
(out,err)=p.communicate()
ret=p.returncode
else:
out,err=(None,None)
ret=subprocess.Popen(cmd,**kw).wait()
except Exception ,e:
raise Errors.WafError('Execution failure: %s'%str(e),ex=e)
示例8: restore
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def restore(self):
try:
env=ConfigSet.ConfigSet(os.path.join(self.cache_dir,'build.config.py'))
except EnvironmentError:
pass
else:
if env['version']<Context.HEXVERSION:
raise Errors.WafError('Version mismatch! reconfigure the project')
for t in env['tools']:
self.setup(**t)
dbfn=os.path.join(self.variant_dir,Context.DBFILE)
try:
data=Utils.readf(dbfn,'rb')
except(IOError,EOFError):
Logs.debug('build: Could not load the build cache %s (missing)'%dbfn)
else:
try:
waflib.Node.pickle_lock.acquire()
waflib.Node.Nod3=self.node_class
try:
data=cPickle.loads(data)
except Exception ,e:
Logs.debug('build: Could not pickle the build cache %s: %r'%(dbfn,e))
else:
示例9: hash_env_vars
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [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
示例10: apply_flags_ifort
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def apply_flags_ifort(self):
if not self.env.IFORT_WIN32 or not getattr(self,'link_task',None):
return
is_static=isinstance(self.link_task,ccroot.stlink_task)
subsystem=getattr(self,'subsystem','')
if subsystem:
subsystem='/subsystem:%s'%subsystem
flags=is_static and'ARFLAGS'or'LINKFLAGS'
self.env.append_value(flags,subsystem)
if not is_static:
for f in self.env.LINKFLAGS:
d=f.lower()
if d[1:]=='debug':
pdbnode=self.link_task.outputs[0].change_ext('.pdb')
self.link_task.outputs.append(pdbnode)
if getattr(self,'install_task',None):
self.pdb_install_task=self.bld.install_files(self.install_task.dest,pdbnode,env=self.env)
break
示例11: exec_mf
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def exec_mf(self):
env=self.env
mtool=env['MT']
if not mtool:
return 0
self.do_manifest=False
outfile=self.outputs[0].abspath()
manifest=None
for out_node in self.outputs:
if out_node.name.endswith('.manifest'):
manifest=out_node.abspath()
break
if manifest is None:
return 0
mode=''
if'fcprogram'in self.generator.features or'fcprogram_test'in self.generator.features:
mode='1'
elif'fcshlib'in self.generator.features:
mode='2'
debug('msvc: embedding manifest in mode %r'%mode)
lst=[]+mtool
lst.extend(Utils.to_list(env['MTFLAGS']))
lst.extend(['-manifest',manifest])
lst.append('-outputresource:%s;%s'%(outfile,mode))
return self.exec_command(lst)
示例12: run
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def run(self):
argparser = fypp.get_option_parser()
args = [FYPP_LINENUM_FLAG]
args += self.env.FYPP_FLAGS
args += [FYPP_DEFINES_ST % ss for ss in self.env['DEFINES']]
args += [FYPP_INCPATH_ST % ss for ss in self.env['INCLUDES']]
args += [FYPP_INIFILES_ST % ss for ss in self.env['INIFILES']]
args += [FYPP_MODULES_ST % ss for ss in self.env['MODULES']]
opts, leftover = argparser.parse_args(args)
infile = self.inputs[0].abspath()
outfile = self.outputs[0].abspath()
if Logs.verbose:
Logs.debug('runner: fypp.Fypp %r %r %r'
% (args, infile, outfile))
tool = fypp.Fypp(opts)
try:
tool.process_file(infile, outfile)
except fypp.FyppError as err:
msg = ("%s [%s:%d]"
% (err.msg, err.fname, err.span[0] + 1))
raise FyppPreprocError(msg)
return 0
示例13: sig_implicit_deps
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def sig_implicit_deps(self):
bld=self.generator.bld
key=self.uid()
prev=bld.task_sigs.get((key,'imp'),[])
if prev:
try:
if prev==self.compute_sig_implicit_deps():
return prev
except Errors.TaskNotReady:
raise
except EnvironmentError:
for x in bld.node_deps.get(self.uid(),[]):
if not x.is_bld():
try:
os.stat(x.abspath())
except OSError:
try:
del x.parent.children[x.name]
except KeyError:
pass
del bld.task_sigs[(key,'imp')]
raise Errors.TaskRescan('rescan')
(nodes,names)=self.scan()
if Logs.verbose:
Logs.debug('deps: scanner for %s returned %s %s'%(str(self),str(nodes),str(names)))
bld.node_deps[key]=nodes
bld.raw_deps[key]=names
self.are_implicit_nodes_ready()
try:
bld.task_sigs[(key,'imp')]=sig=self.compute_sig_implicit_deps()
except Exception:
if Logs.verbose:
for k in bld.node_deps.get(self.uid(),[]):
try:
k.get_bld_sig()
except Exception:
Logs.warn('Missing signature for node %r (may cause rebuilds)'%k)
else:
return sig
示例14: compile_fun_shell
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def compile_fun_shell(line):
extr=[]
def repl(match):
g=match.group
if g('dollar'):return"$"
elif g('backslash'):return'\\\\'
elif g('subst'):extr.append((g('var'),g('code')));return"%s"
return None
line=reg_act.sub(repl,line)or line
parm=[]
dvars=[]
app=parm.append
for(var,meth)in extr:
if var=='SRC':
if meth:app('tsk.inputs%s'%meth)
else:app('" ".join([a.path_from(bld.bldnode) for a in tsk.inputs])')
elif var=='TGT':
if meth:app('tsk.outputs%s'%meth)
else:app('" ".join([a.path_from(bld.bldnode) for a in tsk.outputs])')
elif meth:
if meth.startswith(':'):
m=meth[1:]
if m=='SRC':
m='[a.path_from(bld.bldnode) for a in tsk.inputs]'
elif m=='TGT':
m='[a.path_from(bld.bldnode) for a in tsk.outputs]'
elif m[:3]not in('tsk','gen','bld'):
dvars.extend([var,meth[1:]])
m='%r'%m
app('" ".join(tsk.colon(%r, %s))'%(var,m))
else:
app('%s%s'%(var,meth))
else:
if not var in dvars:dvars.append(var)
app("p('%s')"%var)
if parm:parm="%% (%s) "%(',\n\t\t'.join(parm))
else:parm=''
c=COMPILE_TEMPLATE_SHELL%(line,parm)
Logs.debug('action: %s'%c.strip().splitlines())
return(funex(c),dvars)
示例15: addlines
# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import debug [as 別名]
def addlines(self,node):
self.currentnode_stack.append(node.parent)
filepath=node.abspath()
self.count_files+=1
if self.count_files>c_preproc.recursion_limit:
raise c_preproc.PreprocError("recursion limit exceeded")
pc=self.parse_cache
Logs.debug('preproc: reading file %r',filepath)
try:
lns=pc[filepath]
except KeyError:
pass
else:
self.lines.extend(lns)
return
try:
lines=self.filter_comments(filepath)
lines.append((c_preproc.POPFILE,''))
lines.reverse()
pc[filepath]=lines
self.lines.extend(lines)
except IOError:
raise c_preproc.PreprocError("could not read the file %s"%filepath)
except Exception:
if Logs.verbose>0:
Logs.error("parsing %s failed"%filepath)
traceback.print_exc()