本文整理汇总了Python中waflib.Logs.warn方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.warn方法的具体用法?Python Logs.warn怎么用?Python Logs.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Logs
的用法示例。
在下文中一共展示了Logs.warn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeglossaries
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def makeglossaries(self):
src_file=self.inputs[0].abspath()
base_file=os.path.basename(src_file)
base,_=os.path.splitext(base_file)
for aux_node in self.aux_nodes:
try:
ct=aux_node.read()
except EnvironmentError:
Logs.error('Error reading %s: %r'%aux_node.abspath())
continue
if g_glossaries_re.findall(ct):
if not self.env.MAKEGLOSSARIES:
raise Errors.WafError("The program 'makeglossaries' is missing!")
Logs.warn('calling makeglossaries')
self.env.SRCFILE=base
self.check_status('error when calling makeglossaries %s'%base,self.makeglossaries_fun())
return
示例2: post
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def post(self):
buf=[]
for x in self.source:
if isinstance(x,waflib.Node.Node):
y=x
else:
y=self.path.find_resource(x)
if not y:
if Logs.verbose:
Logs.warn('Could not find %s immediately (may cause broken builds)'%x)
idx=self.generator.bld.get_group_idx(self)
for tg in self.generator.bld.groups[idx]:
if not isinstance(tg,inst)and id(tg)!=id(self):
tg.post()
y=self.path.find_resource(x)
if y:
break
else:
raise Errors.WafError('Could not find %r in %r'%(x,self.path))
buf.append(y)
self.inputs=buf
示例3: configure
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def configure(conf):
"""
Detect the python interpreter
"""
try:
conf.find_program('python', var='PYTHON')
except conf.errors.ConfigurationError:
Logs.warn("could not find a python executable, setting to sys.executable '%s'" % sys.executable)
conf.env.PYTHON = sys.executable
if conf.env.PYTHON != sys.executable:
Logs.warn("python executable %r differs from system %r" % (conf.env.PYTHON, sys.executable))
conf.env.PYTHON = conf.cmd_to_list(conf.env.PYTHON)
v = conf.env
v['PYCMD'] = '"import sys, py_compile;py_compile.compile(sys.argv[1], sys.argv[2])"'
v['PYFLAGS'] = ''
v['PYFLAGS_OPT'] = '-O'
v['PYC'] = getattr(Options.options, 'pyc', 1)
v['PYO'] = getattr(Options.options, 'pyo', 1)
示例4: distclean_dir
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def distclean_dir(dirname):
for(root,dirs,files)in os.walk(dirname):
for f in files:
if _can_distclean(f):
fname=os.path.join(root,f)
try:
os.remove(fname)
except OSError:
Logs.warn('Could not remove %r'%fname)
for x in(Context.DBFILE,'config.log'):
try:
os.remove(x)
except OSError:
pass
try:
shutil.rmtree('c4che')
except OSError:
pass
示例5: update
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def update(ctx):
lst=Options.options.files
if lst:
lst=lst.split(',')
else:
path=os.path.join(Context.waf_dir,'waflib','extras')
lst=[x for x in Utils.listdir(path)if x.endswith('.py')]
for x in lst:
tool=x.replace('.py','')
if not tool:
continue
try:
dl=Configure.download_tool
except AttributeError:
ctx.fatal('The command "update" is dangerous; include the tool "use_config" in your project!')
try:
dl(tool,force=True,ctx=ctx)
except Errors.WafError:
Logs.error('Could not find the tool %r in the remote repository'%x)
else:
Logs.warn('Updated %r'%tool)
示例6: load_module
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [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
示例7: post
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def post(self):
self.features=self.to_list(self.features)
if'cc'in self.features:
if Logs.verbose:
Logs.warn('compat: the feature cc does not exist anymore (use "c")')
self.features.remove('cc')
self.features.append('c')
if'cstaticlib'in self.features:
if Logs.verbose:
Logs.warn('compat: the feature cstaticlib does not exist anymore (use "cstlib" or "cxxstlib")')
self.features.remove('cstaticlib')
self.features.append(('cxx'in self.features)and'cxxstlib'or'cstlib')
if getattr(self,'ccflags',None):
if Logs.verbose:
Logs.warn('compat: "ccflags" was renamed to "cflags"')
self.cflags=self.ccflags
return old_post(self)
示例8: configure
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def configure(conf):
cc = conf.env['COMPILER_CC'] or None
cxx = conf.env['COMPILER_CXX'] or None
if not (cc or cxx):
raise Utils.WafError("neither COMPILER_CC nor COMPILER_CXX are defined; "
"maybe the compiler_cc or compiler_cxx tool has not been configured yet?")
try:
compiler = compiler_mapping[cc]
except KeyError:
try:
compiler = compiler_mapping[cxx]
except KeyError:
Logs.warn("No compiler flags support for compiler %r or %r"
% (cc, cxx))
return
opt_level, warn_level, dbg_level = profiles[Options.options.build_profile]
optimizations = compiler.get_optimization_flags(opt_level)
debug, debug_defs = compiler.get_debug_flags(dbg_level)
warnings = compiler.get_warnings_flags(warn_level)
if cc and not conf.env['CCFLAGS']:
conf.env.append_value('CCFLAGS', optimizations)
conf.env.append_value('CCFLAGS', debug)
conf.env.append_value('CCFLAGS', warnings)
conf.env.append_value('CCDEFINES', debug_defs)
if cxx and not conf.env['CXXFLAGS']:
conf.env.append_value('CXXFLAGS', optimizations)
conf.env.append_value('CXXFLAGS', debug)
conf.env.append_value('CXXFLAGS', warnings)
conf.env.append_value('CXXDEFINES', debug_defs)
示例9: get_proc_env
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def get_proc_env(os_env=None):
env = bld.env
if sys.platform == 'linux2':
pathvar = 'LD_LIBRARY_PATH'
elif sys.platform == 'darwin':
pathvar = 'DYLD_LIBRARY_PATH'
elif sys.platform == 'win32':
pathvar = 'PATH'
elif sys.platform == 'cygwin':
pathvar = 'PATH'
elif sys.platform.startswith('freebsd'):
pathvar = 'LD_LIBRARY_PATH'
else:
Logs.warn(("Don't know how to configure "
"dynamic library path for the platform %r;"
" assuming it's LD_LIBRARY_PATH.") % (sys.platform,))
pathvar = 'LD_LIBRARY_PATH'
proc_env = dict(os.environ)
if os_env is not None:
proc_env.update(os_env)
if pathvar is not None:
if pathvar in proc_env:
proc_env[pathvar] = os.pathsep.join(list(env['NS3_MODULE_PATH']) + [proc_env[pathvar]])
else:
proc_env[pathvar] = os.pathsep.join(list(env['NS3_MODULE_PATH']))
pymoddir = bld.path.find_dir('bindings/python').get_bld().abspath()
pyvizdir = bld.path.find_dir('src/visualizer').abspath()
if 'PYTHONPATH' in proc_env:
proc_env['PYTHONPATH'] = os.pathsep.join([pymoddir, pyvizdir] + [proc_env['PYTHONPATH']])
else:
proc_env['PYTHONPATH'] = os.pathsep.join([pymoddir, pyvizdir])
if 'PATH' in proc_env:
proc_env['PATH'] = os.pathsep.join(list(env['NS3_EXECUTABLE_PATH']) + [proc_env['PATH']])
else:
proc_env['PATH'] = os.pathsep.join(list(env['NS3_EXECUTABLE_PATH']))
return proc_env
示例10: get_proc_env
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def get_proc_env(os_env=None):
env = bld.env
if sys.platform == 'linux2' or sys.platform == 'linux':
pathvar = 'LD_LIBRARY_PATH'
elif sys.platform == 'darwin':
pathvar = 'DYLD_LIBRARY_PATH'
elif sys.platform == 'win32':
pathvar = 'PATH'
elif sys.platform == 'cygwin':
pathvar = 'PATH'
elif sys.platform.startswith('freebsd'):
pathvar = 'LD_LIBRARY_PATH'
else:
Logs.warn(("Don't know how to configure "
"dynamic library path for the platform %r;"
" assuming it's LD_LIBRARY_PATH.") % (sys.platform,))
pathvar = 'LD_LIBRARY_PATH'
proc_env = dict(os.environ)
if os_env is not None:
proc_env.update(os_env)
if pathvar is not None:
if pathvar in proc_env:
proc_env[pathvar] = os.pathsep.join(list(env['NS3_MODULE_PATH']) + [proc_env[pathvar]])
else:
proc_env[pathvar] = os.pathsep.join(list(env['NS3_MODULE_PATH']))
pymoddir = bld.path.find_dir('bindings/python').get_bld().abspath()
pyvizdir = bld.path.find_dir('src/visualizer').abspath()
if 'PYTHONPATH' in proc_env:
proc_env['PYTHONPATH'] = os.pathsep.join([pymoddir, pyvizdir] + [proc_env['PYTHONPATH']])
else:
proc_env['PYTHONPATH'] = os.pathsep.join([pymoddir, pyvizdir])
if 'PATH' in proc_env:
proc_env['PATH'] = os.pathsep.join(list(env['NS3_EXECUTABLE_PATH']) + [proc_env['PATH']])
else:
proc_env['PATH'] = os.pathsep.join(list(env['NS3_EXECUTABLE_PATH']))
return proc_env
示例11: sig_implicit_deps
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [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
示例12: find_msvc
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def find_msvc(conf):
if sys.platform=='cygwin':
conf.fatal('MSVC module does not work under cygwin Python!')
v=conf.env
path=v['PATH']
compiler=v['MSVC_COMPILER']
version=v['MSVC_VERSION']
compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
v.MSVC_MANIFEST=(compiler=='msvc'and version>=8)or(compiler=='wsdk'and version>=6)or(compiler=='intel'and version>=11)
cxx=None
if v['CXX']:cxx=v['CXX']
elif'CXX'in conf.environ:cxx=conf.environ['CXX']
cxx=conf.find_program(compiler_name,var='CXX',path_list=path)
env=dict(conf.environ)
if path:env.update(PATH=';'.join(path))
if not conf.cmd_and_log(cxx+['/nologo','/help'],env=env):
conf.fatal('the msvc compiler could not be identified')
v['CC']=v['CXX']=cxx
v['CC_NAME']=v['CXX_NAME']='msvc'
if not v['LINK_CXX']:
link=conf.find_program(linker_name,path_list=path)
if link:v['LINK_CXX']=link
else:conf.fatal('%s was not found (linker)'%linker_name)
v['LINK']=link
if not v['LINK_CC']:
v['LINK_CC']=v['LINK_CXX']
if not v['AR']:
stliblink=conf.find_program(lib_name,path_list=path,var='AR')
if not stliblink:return
v['ARFLAGS']=['/NOLOGO']
if v.MSVC_MANIFEST:
conf.find_program('MT',path_list=path,var='MT')
v['MTFLAGS']=['/NOLOGO']
try:
conf.load('winres')
except Errors.WafError:
warn('Resource compiler not found. Compiling resource file is disabled')
示例13: distclean
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def distclean(ctx):
'''removes the build directory'''
lst=os.listdir('.')
for f in lst:
if f==Options.lockfile:
try:
proj=ConfigSet.ConfigSet(f)
except IOError:
Logs.warn('Could not read %r'%f)
continue
if proj['out_dir']!=proj['top_dir']:
try:
shutil.rmtree(proj['out_dir'])
except IOError:
pass
except OSError ,e:
if e.errno!=errno.ENOENT:
Logs.warn('Could not remove %r'%proj['out_dir'])
else:
distclean_dir(proj['out_dir'])
for k in(proj['out_dir'],proj['top_dir'],proj['run_dir']):
p=os.path.join(k,Options.lockfile)
try:
os.remove(p)
except OSError ,e:
if e.errno!=errno.ENOENT:
Logs.warn('Could not remove %r'%p)
示例14: autoconfigure
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [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
示例15: post_group
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import warn [as 别名]
def post_group(self):
if self.targets=='*':
for tg in self.groups[self.cur]:
try:
f=tg.post
except AttributeError:
pass
else:
f()
elif self.targets:
if self.cur<self._min_grp:
for tg in self.groups[self.cur]:
try:
f=tg.post
except AttributeError:
pass
else:
f()
else:
for tg in self._exact_tg:
tg.post()
else:
ln=self.launch_node()
if ln.is_child_of(self.bldnode):
Logs.warn('Building from the build directory, forcing --targets=*')
ln=self.srcnode
elif not ln.is_child_of(self.srcnode):
Logs.warn('CWD %s is not under %s, forcing --targets=* (run distclean?)'%(ln.abspath(),self.srcnode.abspath()))
ln=self.srcnode
for tg in self.groups[self.cur]:
try:
f=tg.post
except AttributeError:
pass
else:
if tg.path.is_child_of(ln):
f()