当前位置: 首页>>代码示例>>Python>>正文


Python TaskGen类代码示例

本文整理汇总了Python中TaskGen的典型用法代码示例。如果您正苦于以下问题:Python TaskGen类的具体用法?Python TaskGen怎么用?Python TaskGen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TaskGen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_missing_mapping

	def test_missing_mapping(self):
		# no mapping for extension
		bld = self.make_bld()
		obj = TaskGen.task_gen(bld=bld)
		obj.source = self._source_file_path
		self._write_source("int main() {return 0;}")
		self.failUnlessRaises(Utils.WafError, obj.apply_core)
开发者ID:farthought,项目名称:waf15,代码行数:7,代码来源:task_gen.py

示例2: new_task_gen

	def new_task_gen(self,*k,**kw):
		kw['bld']=self
		if len(k)==0:return TaskGen.task_gen(*k,**kw)
		cls_name=k[0]
		try:cls=TaskGen.task_gen.classes[cls_name]
		except KeyError:raise Utils.WscriptError('%s is not a valid task generator -> %s'%(cls_name,[x for x in TaskGen.task_gen.classes]))
		else:return cls(*k,**kw)
开发者ID:johnsen,项目名称:jack2,代码行数:7,代码来源:Build.py

示例3: new_task_gen

	def new_task_gen(self, *k, **kw):
		if self.task_gen_cache_names:
			self.task_gen_cache_names = {}

		kw['bld'] = self
		if len(k) == 0:
			ret = TaskGen.task_gen(*k, **kw)
		else:
			cls_name = k[0]

			try: cls = TaskGen.task_gen.classes[cls_name]
			except KeyError: raise Utils.WscriptError('{0!s} is not a valid task generator -> {1!s}'.format(cls_name, [x for x in TaskGen.task_gen.classes]))
			ret = cls(*k, **kw)
		return ret
开发者ID:runt18,项目名称:samba,代码行数:14,代码来源:Build.py

示例4: test_white_no_sources_specified

	def test_white_no_sources_specified(self):
		# white-box test: no sources were specified

		# add apply_verif to taskgen
		import Tools.ccroot

		Options.commands['configure'] = False
		env = Environment.Environment()
		bld = Build.bld = Build.BuildContext()
		bld.set_env('default', env)
		blddir = os.path.join(self._test_dir_root, 'b')
		bld.load_dirs(self._test_dir_root, blddir)

		obj = TaskGen.task_gen(bld=bld)
		# TODO: make sure it works with apply_core too
		self.failUnlessRaises(Utils.WafError, obj.apply_verif)
开发者ID:farthought,项目名称:waf15,代码行数:16,代码来源:task_gen.py

示例5: test_validate_find_srcs_absolute

	def test_validate_find_srcs_absolute(self):
		# find sources in dirs cannot get absoulte paths
		bld = self.make_bld()
		obj = TaskGen.task_gen(bld=bld)
		self.failUnlessRaises(Utils.WafError, obj.find_sources_in_dirs, self._test_dir_root)
开发者ID:farthought,项目名称:waf15,代码行数:5,代码来源:task_gen.py

示例6: return

			if not nd: nd = x.find_resource(name+'.ml')
			if nd:
				found_lst.append(nd)
				break
		else:
			raw_lst.append(name)

	return (found_lst, raw_lst)

native_lst=['native', 'all', 'c_object']
bytecode_lst=['bytecode', 'all']
class ocaml_taskgen(TaskGen.task_gen):
	def __init__(self, *k, **kw):
		TaskGen.task_gen.__init__(self, *k, **kw)

TaskGen.bind_feature('ocaml', 'apply_core')

@taskgen
@feature('ocaml')
def init_ml(self):
	Utils.def_attrs(self,
		type = 'all',
		incpaths_lst = [],
		bld_incpaths_lst = [],
		mlltasks = [],
		mlytasks = [],
		mlitasks = [],
		native_tasks = [],
		bytecode_tasks = [],
		linktasks = [],
		bytecode_env = None,
开发者ID:Reilithion,项目名称:xmms2-reilithion,代码行数:31,代码来源:ocaml.py

示例7: decide_ext

#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
# Thomas Nagy, 2006-2008

"Flex processing"

import TaskGen

def decide_ext(self, node):
	if 'cxx' in self.features: return '.lex.cc'
	else: return '.lex.c'

TaskGen.declare_chain(
	name = 'flex',
	rule = '${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',
	ext_in = '.l',
	ext_out = '.c .cxx',
	decider = decide_ext,
)

def detect(conf):
	conf.find_program('flex', var='FLEX', mandatory=True)
	conf.env['FLEXFLAGS'] = ''

开发者ID:anandu,项目名称:pylibs,代码行数:24,代码来源:flex.py

示例8: __call__

 def __call__(self, *k, **kw):
     if self.task_gen_cache_names:
         self.task_gen_cache_names = {}
     kw["bld"] = self
     return TaskGen.task_gen(*k, **kw)
开发者ID:henokyen,项目名称:EOH,代码行数:5,代码来源:Build.py

示例9: edje

def edje(self):
	self.default_chmod=0664
	bld_rule = '${EDJE} '+'-id '+self.cwd+' -fd '+self.cwd+' ${SRC} ${TGT}'
	TaskGen.declare_chain(name='edje_cc', rule=bld_rule, ext_in='.edc', ext_out='.edj', reentrant=0, install=None)
开发者ID:paulomenin,项目名称:rockon,代码行数:4,代码来源:edje.py

示例10: cscan

def cscan(self):

	txt = self.inputs[0].read(self.env)
	mods = []
	for m in re_cyt.finditer(txt):
		mods.append(m.group(1))

	incs = getattr(self.generator, 'cython_includes', [])
	incs = [self.generator.path.find_dir(x) for x in incs]
	incs.append(self.inputs[0].parent)

	found = []
	missing = []
	for x in mods:
		for y in incs:
			k = y.find_resource(x + '.pxd')
			if k:
				found.append(k)
				break
		else:
			missing.append(x)

	return (found, missing)

TaskGen.declare_chain(name='cython', rule='${CYTHON} ${CYTHONFLAGS} ${SRC} -o ${TGT}', ext_in=['.pyx'], ext_out=['.c'], scan=cscan)

def detect(conf):
	conf.find_program('cython', var='CYTHON', mandatory=True)

开发者ID:farthought,项目名称:waf15,代码行数:28,代码来源:cython.py

示例11: default_cython

		if copy:
			copy.close()
	try:
		os.remove(src_file)
	except OSError:
		pass
	except IOError:
		pass
	else:
		os.rename(copy_file, src_file)
	return 0

f = TaskGen.declare_chain(
		name = 'cythonc',
		action = cython_run,
		ext_in = '.pyx',
		ext_out = '.c',
		reentrant = True,
		after='apply_cython_extra',
		scan=scan_deps)

@TaskGen.feature('cython')
@TaskGen.before('apply_core')
def default_cython(self):
	Utils.def_attrs(self,
			cython_includes = '',
			no_timestamp = False)

@TaskGen.feature('cython')
@TaskGen.after('apply_core')
def apply_cython_incpaths(self):
	"""Used to build _CYTHONINCFLAGS, and the dependencies scanner (when ready).
开发者ID:mantaraya36,项目名称:xmms2-mantaraya36,代码行数:32,代码来源:cython.py

示例12: __call__

	def __call__(self, *k, **kw):
		kw['bld'] = self
		return TaskGen.task_gen(*k, **kw)
开发者ID:theefer,项目名称:xmms2-coll-parser,代码行数:3,代码来源:Build.py

示例13: init_f

	task = self.create_task('fortranpp')
	task.inputs = [node]
	task.outputs = [node.change_ext(obj_ext)]
	self.compiled_tasks.append(task)
	return task

#################################################### Task generators

# we reuse a lot of code from ccroot.py

FORTRAN = 'init_f default_cc apply_incpaths apply_defines_cc apply_type_vars apply_lib_vars add_extra_flags apply_obj_vars_cc'.split()
FPROGRAM = 'apply_verif vars_target_cprogram install_target_cstaticlib apply_objdeps apply_obj_vars '.split()
FSHLIB = 'apply_verif vars_target_cstaticlib install_target_cstaticlib install_target_cshlib apply_objdeps apply_obj_vars apply_vnum'.split()
FSTATICLIB = 'apply_verif vars_target_cstaticlib install_target_cstaticlib apply_objdeps apply_obj_vars '.split()

TaskGen.bind_feature('fortran', FORTRAN)
TaskGen.bind_feature('fprogram', FPROGRAM)
TaskGen.bind_feature('fshlib', FSHLIB)
TaskGen.bind_feature('fstaticlib', FSTATICLIB)

TaskGen.declare_order('init_f', 'apply_lib_vars')
TaskGen.declare_order('default_cc', 'apply_core')

@feature('fortran')
@before('apply_type_vars')
@after('default_cc')
def init_f(self):
	# PATH flags:
	#	- CPPPATH: same as C, for pre-processed fortran files
	#	- FORTRANMODPATH: where to look for modules (.mod)
	#	- FORTRANMODOUTPATH: where to *put* modules (.mod)
开发者ID:farthought,项目名称:waf15,代码行数:31,代码来源:fortran.py

示例14: Copyright

# encoding: utf-8

# inkscape-convert - Convert svg files to pdf
# Copyright (C) 2009 Michael Budde

import TaskGen

TaskGen.declare_chain(
    name='inkscape-svg-convert',
    action='${INKSCAPE} ${INKSCAPEFLAGS} --export-pdf=${TGT} ${SRC}',
    ext_in='.svg',
    ext_out='.pdf',
    reentrant=False)

def detect(conf):
    conf.find_program('inkscape', var='INKSCAPE', mandatory=True)
    conf.env['INKSCAPEFLAGS'] = ''
开发者ID:mbudde,项目名称:waf-tools,代码行数:17,代码来源:inkscape-convert.py

示例15: decide_ext

#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006

"Bison processing"

import TaskGen

def decide_ext(self, node):
	c_ext = '.tab.c'
	if node.name.endswith('.yc'): c_ext = '.tab.cc'
	if '-d' in self.env['BISONFLAGS']:
		return [c_ext, c_ext.replace('c', 'h')]
	else:
		return c_ext

TaskGen.declare_chain(
	name = 'bison',
	rule = 'cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}',
	ext_in = '.y .yc .yy',
	decider = decide_ext,
	before = 'cc cxx',
)

def detect(conf):
	bison = conf.find_program('bison', var='BISON', mandatory=True)
	v = conf.env
	v['BISONFLAGS'] = '-d'

开发者ID:Reilithion,项目名称:xmms2-reilithion,代码行数:28,代码来源:bison.py


注:本文中的TaskGen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。