當前位置: 首頁>>代碼示例>>Python>>正文


Python TaskGen.feature方法代碼示例

本文整理匯總了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__) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:22,代碼來源:errcheck.py

示例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) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:19,代碼來源:compat15.py

示例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__) 
開發者ID:KTH,項目名稱:royal-chaos,代碼行數:24,代碼來源:errcheck.py

示例4: feature_py

# 需要導入模塊: from waflib import TaskGen [as 別名]
# 或者: from waflib.TaskGen import feature [as 別名]
def feature_py(self):
	"""
	Dummy feature which does nothing
	"""
	pass 
開發者ID:ntu-dsi-dcn,項目名稱:ntu-dsi-dcn,代碼行數:7,代碼來源:python.py


注:本文中的waflib.TaskGen.feature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。