本文整理匯總了Python中waflib.TaskGen.feature方法的典型用法代碼示例。如果您正苦於以下問題:Python TaskGen.feature方法的具體用法?Python TaskGen.feature怎麽用?Python TaskGen.feature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類waflib.TaskGen
的用法示例。
在下文中一共展示了TaskGen.feature方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: check_invalid_constraints
# 需要導入模塊: from waflib import TaskGen [as 別名]
# 或者: from waflib.TaskGen import feature [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__)
示例2: post
# 需要導入模塊: from waflib import TaskGen [as 別名]
# 或者: from waflib.TaskGen import feature [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)
示例3: check_invalid_constraints
# 需要導入模塊: from waflib import TaskGen [as 別名]
# 或者: from waflib.TaskGen import feature [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__)
示例4: feature_py
# 需要導入模塊: from waflib import TaskGen [as 別名]
# 或者: from waflib.TaskGen import feature [as 別名]
def feature_py(self):
"""
Dummy feature which does nothing
"""
pass