本文整理汇总了Python中waflib.Logs.debug方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.debug方法的具体用法?Python Logs.debug怎么用?Python Logs.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Logs
的用法示例。
在下文中一共展示了Logs.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: configure
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def configure(ctx):
msg.debug('[configure] package name: '+PACKAGE['name'])
ctx.load('find_root')
ctx.load('find_xrootd')
ctx.load('find_gccxml')
if ctx.hwaf_enabled_tag("STANDALONE"):
ctx.load('find_root')
ctx.find_root()
return
macro = ctx.hwaf_declare_macro
macro("ROOT_native_version", "${ROOT_config_version}")
macro("ROOT_base", "${LCG_releases}/ROOT/${ROOT_native_version}")
macro("ROOT_home", "${ROOT_base}/${LCG_platform}/root")
macro("ROOTSYS", "${ROOT_home}")
ctx.hwaf_declare_runtime_env("ROOTSYS")
macro("ROOT_HOME", "${ROOT_home}")
macro("ROOT_export_paths", "${ROOTSYS}")
ctx.lcg_declare_external_package('ROOT', path='${ROOTSYS}')
path = ctx.hwaf_subst_vars("${ROOTSYS}")
binpath = ctx.hwaf_subst_vars("${ROOTSYS}/bin")
ctx.find_root(path_list=[binpath], extra_paths=[path])
return
示例2: 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
示例3: clean
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def clean(self):
"""
Remove most files from the build directory, and reset all caches.
Custom lists of files to clean can be declared as `bld.clean_files`.
For example, exclude `build/program/myprogram` from getting removed::
def build(bld):
bld.clean_files = bld.bldnode.ant_glob('**',
excl='.lock* config.log c4che/* config.h program/myprogram',
quiet=True, generator=True)
"""
Logs.debug('build: clean called')
if hasattr(self, 'clean_files'):
for n in self.clean_files:
n.delete()
elif self.bldnode != self.srcnode:
# would lead to a disaster if top == out
lst = []
for env in self.all_envs.values():
lst.extend(self.root.find_or_declare(f) for f in env[CFG_FILES])
for n in self.bldnode.ant_glob('**/*', excl='.lock* *conf_check_*/** config.log c4che/*', quiet=True):
if n in lst:
continue
n.delete()
self.root.children = {}
for v in SAVED_ATTRS:
if v == 'root':
continue
setattr(self, v, {})
示例4: run
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def run(self):
env = self.env
gen = self.generator
path = gen.path
bld = gen.bld
bjam = gen.bld.root.find_dir(env.BJAM_SRC)
if not bjam:
Logs.error("Can not find bjam source")
return -1
bjam_exe_relpath = "bin." + env.BJAM_UNAME + "/bjam"
bjam_exe = bjam.find_resource(bjam_exe_relpath)
if bjam_exe:
env.BJAM = bjam_exe.srcpath()
return 0
bjam_cmd = ["./build.sh"]
Logs.debug("runner: " + bjam.srcpath() + "> " + str(bjam_cmd))
result = self.exec_command(bjam_cmd, cwd=bjam.srcpath())
if not result == 0:
Logs.error("bjam failed")
return -1
bjam_exe = bjam.find_resource(bjam_exe_relpath)
if bjam_exe:
env.BJAM = bjam_exe.srcpath()
return 0
Logs.error("bjam failed")
return -1
示例5: exec_command
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def exec_command(self, cmd, **kw):
"""
execute a command, return the exit status
if the context has the attribute 'log', capture and log the process stderr/stdout
this method should be used whenever possible for proper logging
@param cmd: args for subprocess.Popen
@param kw: keyword arguments for subprocess.Popen
"""
subprocess = Utils.subprocess
kw['shell'] = isinstance(cmd, str)
Logs.debug('runner: %r' % cmd)
try:
if self.logger:
# warning: may deadlock with a lot of output (subprocess limitation)
self.logger.info(cmd)
kw['stdout'] = kw['stderr'] = subprocess.PIPE
p = subprocess.Popen(cmd, **kw)
(out, err) = p.communicate()
if out:
self.logger.debug('out: %s' % out.decode('utf-8'))
if err:
self.logger.error('err: %s' % err.decode('utf-8'))
return p.returncode
else:
p = subprocess.Popen(cmd, **kw)
return p.wait()
except OSError:
return -1
示例6: restore
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def restore(self):
"""
Load the data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
"""
try:
env = ConfigSet.ConfigSet(os.path.join(self.cache_dir, 'build.config.py'))
except (IOError, OSError):
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):
# handle missing file/empty file
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 as e:
Logs.debug('build: Could not pickle the build cache %s: %r' % (dbfn, e))
else:
for x in SAVED_ATTRS:
setattr(self, x, data[x])
finally:
waflib.Node.pickle_lock.release()
self.init_dirs()
示例7: parse_node
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def parse_node(node):
if node in seen:
return
seen.append(node)
code = node.read()
global re_tex
for match in re_tex.finditer(code):
for path in match.group('file').split(','):
if path:
add_name = True
found = None
for k in exts_deps_tex:
Logs.debug('tex: trying %s%s' % (path, k))
found = node.parent.find_resource(path + k)
for tsk in self.generator.tasks:
if not found or found in tsk.outputs:
break
else:
nodes.append(found)
add_name = False
for ext in exts_tex:
if found.name.endswith(ext):
parse_node(found)
break
# no break, people are crazy
if add_name:
names.append(path)
示例8: hash_env_vars
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def hash_env_vars(self, env, vars_lst):
# reimplement so that the resulting hash does not depend on local paths
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
v = str([env[a] for a in vars_lst])
v = v.replace(self.srcnode.abspath().__repr__()[:-1], "")
m = Utils.md5()
m.update(v.encode())
ret = m.digest()
Logs.debug("envhash: %r %r", ret, v)
cache[idx] = ret
return ret
示例9: 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(':'):
app('" ".join([env[%r] %% x for x in env[%r]])'%(var,meth[1:]))
dvars.extend([var,meth[1:]])
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)
return(funex(c),dvars)
示例10: execute
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def execute(self):
self.init_dirs()
self.cachedir = self.bldnode.find_node(waflib.Build.CACHE_DIR)
if not self.cachedir:
self.fatal(
"no CACHE_DIR (%s). run 'hwaf configure' first" %
osp.join(self.bldnode.abspath(), waflib.Build.CACHE_DIR))
pass
msg.debug("hwaf: run-cmd options: %s" % waflib.Options.commands)
if not waflib.Options.commands:
self.fatal('%s expects at least one package name. got: %s' %
(self.cmd, waflib.Options.commands))
args = []
while waflib.Options.commands:
arg = waflib.Options.commands.pop(0)
args.append(arg)
pass
msg.debug("hwaf: run-cmd args: %s" % args)
self.env.load(self.cachedir.find_node("_cache.py").abspath())
self.env.HWAF_ENABLE_INSTALL_AREA = '1'
self.hwaf_setup_runtime()
ret = hwaf_run_cmd_with_runtime_env(self, args)
return ret
示例11: 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()
示例12: 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(EnvironmentError,EOFError):
Logs.debug('build: Could not load the build cache %s (missing)',dbfn)
else:
try:
Node.pickle_lock.acquire()
Node.Nod3=self.node_class
try:
data=cPickle.loads(data)
except Exception as e:
Logs.debug('build: Could not pickle the build cache %s: %r',dbfn,e)
else:
for x in SAVED_ATTRS:
setattr(self,x,data[x])
finally:
Node.pickle_lock.release()
self.init_dirs()
示例13: scan
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def scan(self):
parser = FyppIncludeParser(self.generator.includes_nodes)
nodes, names = parser.parse(self.inputs[0])
if Logs.verbose:
Logs.debug('deps: deps for %r: %r; unresolved: %r'
% (self.inputs, nodes, names))
return (nodes, names)
示例14: put_files_cache
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def put_files_cache(self):
if not Task.push_addr:
return
if not self.outputs:
return
if getattr(self, 'cached', None):
return
#print "called put_files_cache", id(self)
bld = self.generator.bld
sig = self.signature()
ssig = Utils.to_hex(self.uid() + sig)
conn = None
cnt = 0
try:
for node in self.outputs:
# We could re-create the signature of the task with the signature of the outputs
# in practice, this means hashing the output files
# this is unnecessary
try:
if not conn:
conn = get_connection(push=True)
sock_send(conn, ssig, cnt, node.abspath())
except Exception as e:
Logs.debug("netcache: could not push the files %r" % e)
# broken connection? remove this one
close_connection(conn)
conn = None
cnt += 1
finally:
release_connection(conn, push=True)
bld.task_sigs[self.uid()] = self.cache_sig
示例15: configure
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import debug [as 别名]
def configure(conf):
"""
Try to find a suitable Fortran compiler or raise a :py:class:`waflib.Errors.ConfigurationError`.
"""
try:
test_for_compiler = conf.options.check_fc
except AttributeError:
conf.fatal("Add options(opt): opt.load('compiler_fc')")
for compiler in test_for_compiler.split():
conf.env.stash()
conf.start_msg("Checking for %r (fortran compiler)" % compiler)
try:
conf.load(compiler)
except conf.errors.ConfigurationError as 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)
else:
conf.fatal("could not configure a fortran compiler!")
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:27,代码来源:compiler_fc.py