本文整理汇总了Python中waflib.Logs.error方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.error方法的具体用法?Python Logs.error怎么用?Python Logs.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Logs
的用法示例。
在下文中一共展示了Logs.error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scan
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def scan(self):
if not has_xml:
Logs.error('no xml support was found, the rcc dependencies will be incomplete!')
return([],[])
parser=make_parser()
curHandler=XMLHandler()
parser.setContentHandler(curHandler)
fi=open(self.inputs[0].abspath(),'r')
try:
parser.parse(fi)
finally:
fi.close()
nodes=[]
names=[]
root=self.inputs[0].parent
for x in curHandler.files:
nd=root.find_resource(x)
if nd:nodes.append(nd)
else:names.append(x)
return(nodes,names)
示例2: check_invalid_constraints
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def check_invalid_constraints(self):
feat=set([])
for x in list(TaskGen.feats.values()):
feat.union(set(x))
for(x,y)in TaskGen.task_gen.prec.items():
feat.add(x)
feat.union(set(y))
ext=set([])
for x in TaskGen.task_gen.mappings.values():
ext.add(x.__name__)
invalid=ext&feat
if invalid:
Logs.error('The methods %r have invalid annotations: @extension <-> @feature/@before_method/@after_method'%list(invalid))
for cls in list(Task.classes.values()):
for x in('before','after'):
for y in Utils.to_list(getattr(cls,x,[])):
if not Task.classes.get(y,None):
Logs.error('Erroneous order constraint %r=%r on task class %r'%(x,y,cls.__name__))
if getattr(cls,'rule',None):
Logs.error('Erroneous attribute "rule" on task class %r (rename to "run_str")'%cls.__name__)
示例3: bibfile
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def bibfile(self):
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_bibtex_re.findall(ct):
Logs.info('calling bibtex')
self.env.env={}
self.env.env.update(os.environ)
self.env.env.update({'BIBINPUTS':self.texinputs(),'BSTINPUTS':self.texinputs()})
self.env.SRCFILE=aux_node.name[:-4]
self.check_status('error when calling bibtex',self.bibtex_fun())
for node in getattr(self,'multibibs',[]):
self.env.env={}
self.env.env.update(os.environ)
self.env.env.update({'BIBINPUTS':self.texinputs(),'BSTINPUTS':self.texinputs()})
self.env.SRCFILE=node.name[:-4]
self.check_status('error when calling bibtex',self.bibtex_fun())
示例4: makeglossaries
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [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
示例5: run
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def run(self):
env=self.env
if not env['PROMPT_LATEX']:
env.append_value('LATEXFLAGS','-interaction=batchmode')
env.append_value('PDFLATEXFLAGS','-interaction=batchmode')
env.append_value('XELATEXFLAGS','-interaction=batchmode')
self.cwd=self.inputs[0].parent.get_bld().abspath()
Logs.info('first pass on %s'%self.__class__.__name__)
cur_hash=self.hash_aux_nodes()
self.call_latex()
self.hash_aux_nodes()
self.bibtopic()
self.bibfile()
self.bibunits()
self.makeindex()
self.makeglossaries()
for i in range(10):
prev_hash=cur_hash
cur_hash=self.hash_aux_nodes()
if not cur_hash:
Logs.error('No aux.h to process')
if cur_hash and cur_hash==prev_hash:
break
Logs.info('calling %s'%self.__class__.__name__)
self.call_latex()
示例6: load_envs
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def load_envs(self):
node=self.root.find_node(self.cache_dir)
if not node:
raise Errors.WafError('The project was not configured: run "waf configure" first!')
lst=node.ant_glob('**/*%s'%CACHE_SUFFIX,quiet=True)
if not lst:
raise Errors.WafError('The cache directory is empty: reconfigure the project')
for x in lst:
name=x.path_from(node).replace(CACHE_SUFFIX,'').replace('\\','/')
env=ConfigSet.ConfigSet(x.abspath())
self.all_envs[name]=env
for f in env[CFG_FILES]:
newnode=self.root.find_resource(f)
try:
h=Utils.h_file(newnode.abspath())
except(IOError,AttributeError):
Logs.error('cannot find %r'%f)
h=Utils.SIG_NIL
newnode.sig=h
示例7: check_invalid_constraints
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def check_invalid_constraints(self):
feat=set([])
for x in list(TaskGen.feats.values()):
feat.union(set(x))
for(x,y)in TaskGen.task_gen.prec.items():
feat.add(x)
feat.union(set(y))
ext=set([])
for x in TaskGen.task_gen.mappings.values():
ext.add(x.__name__)
invalid=ext&feat
if invalid:
Logs.error('The methods %r have invalid annotations: @extension <-> @feature/@before_method/@after_method'%list(invalid))
for cls in list(Task.classes.values()):
if sys.hexversion>0x3000000 and issubclass(cls,Task.Task)and isinstance(cls.hcode,str):
raise Errors.WafError('Class %r has hcode value %r of type <str>, expecting <bytes> (use Utils.h_cmd() ?)'%(cls,cls.hcode))
for x in('before','after'):
for y in Utils.to_list(getattr(cls,x,[])):
if not Task.classes.get(y,None):
Logs.error('Erroneous order constraint %r=%r on task class %r'%(x,y,cls.__name__))
if getattr(cls,'rule',None):
Logs.error('Erroneous attribute "rule" on task class %r (rename to "run_str")'%cls.__name__)
示例8: update
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [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)
示例9: boost_get_version
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def boost_get_version(self, d):
"""silently retrieve the boost version number"""
node = self.__boost_get_version_file(d)
if node:
try:
txt = node.read()
except EnvironmentError:
Logs.error("Could not read the file %r" % node.abspath())
else:
re_but = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.*)"', re.M)
m = re_but.search(txt)
if m:
return m.group(1)
return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True)
示例10: addlines
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [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()
示例11: check_same_targets
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def check_same_targets(self):
mp=Utils.defaultdict(list)
uids={}
def check_task(tsk):
if not isinstance(tsk,Task.Task):
return
for node in tsk.outputs:
mp[node].append(tsk)
try:
uids[tsk.uid()].append(tsk)
except KeyError:
uids[tsk.uid()]=[tsk]
for g in self.groups:
for tg in g:
try:
for tsk in tg.tasks:
check_task(tsk)
except AttributeError:
check_task(tg)
dupe=False
for(k,v)in mp.items():
if len(v)>1:
dupe=True
msg='* Node %r is created more than once%s. The task generators are:'%(k,Logs.verbose==1 and" (full message on 'waf -v -v')"or"")
Logs.error(msg)
for x in v:
if Logs.verbose>1:
Logs.error(' %d. %r'%(1+v.index(x),x.generator))
else:
Logs.error(' %d. %r in %r'%(1+v.index(x),x.generator.name,getattr(x.generator,'path',None)))
if not dupe:
for(k,v)in uids.items():
if len(v)>1:
Logs.error('* Several tasks use the same identifier. Please check the information on\n https://waf.io/apidocs/Task.html?highlight=uid#waflib.Task.Task.uid')
for tsk in v:
Logs.error(' - object %r (%r) defined in %r'%(tsk.__class__.__name__,tsk,tsk.generator))
示例12: replace
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def replace(m):
oldcall=getattr(Build.BuildContext,m)
def call(self,*k,**kw):
ret=oldcall(self,*k,**kw)
for x in typos:
if x in kw:
if x=='iscopy'and'subst'in getattr(self,'features',''):
continue
err=True
Logs.error('Fix the typo %r -> %r on %r'%(x,typos[x],ret))
return ret
setattr(Build.BuildContext,m,call)
示例13: bibunits
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def bibunits(self):
try:
bibunits=bibunitscan(self)
except OSError:
Logs.error('error bibunitscan')
else:
if bibunits:
fn=['bu'+str(i)for i in range(1,len(bibunits)+1)]
if fn:
Logs.info('calling bibtex on bibunits')
for f in fn:
self.env.env={'BIBINPUTS':self.texinputs(),'BSTINPUTS':self.texinputs()}
self.env.SRCFILE=f
self.check_status('error when calling bibtex',self.bibtex_fun())
示例14: makeindex
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def makeindex(self):
self.idx_node=self.inputs[0].change_ext('.idx')
try:
idx_path=self.idx_node.abspath()
os.stat(idx_path)
except OSError:
Logs.info('index file %s absent, not calling makeindex'%idx_path)
else:
Logs.info('calling makeindex')
self.env.SRCFILE=self.idx_node.name
self.env.env={}
self.check_status('error when calling makeindex %s'%idx_path,self.makeindex_fun())
示例15: update
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import error [as 别名]
def update(ctx):
lst=Options.options.files.split(',')
if not lst:
lst=[x for x in Utils.listdir(Context.waf_dir+'/waflib/extras')if x.endswith('.py')]
for x in lst:
tool=x.replace('.py','')
try:
Configure.download_tool(tool,force=True,ctx=ctx)
except Errors.WafError:
Logs.error('Could not find the tool %s in the remote repository'%x)