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


Python TaskGen.declare_chain方法代码示例

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


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

示例1: decide_ext

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/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,代码行数:26,代码来源:flex.py

示例2: init_lua

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8

import TaskGen
from TaskGen import taskgen,feature
from Constants import*
TaskGen.declare_chain(name='luac',rule='${LUAC} -s -o ${TGT} ${SRC}',ext_in='.lua',ext_out='.luac',reentrant=0,install='LUADIR',)
def init_lua(self):
	self.default_chmod=O755
def detect(conf):
	conf.find_program('luac',var='LUAC',mandatory=True)

feature('lua')(init_lua)
开发者ID:Acidburn0zzz,项目名称:libdesktop-agnostic,代码行数:15,代码来源:lua.py

示例3: edje

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
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,代码行数:6,代码来源:edje.py

示例4: detect

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# Ali Sabil, 2007

import TaskGen

TaskGen.declare_chain(
	name = 'gob2',
	rule = '${GOB2} -o ${TGT[0].bld_dir(env)} ${GOB2FLAGS} ${SRC}',
	ext_in = '.gob',
	ext_out = '.c'
)

def detect(conf):
	gob2 = conf.find_program('gob2', var='GOB2', mandatory=True)
	conf.env['GOB2'] = gob2
	conf.env['GOB2FLAGS'] = ''

开发者ID:337240552,项目名称:node,代码行数:19,代码来源:gob2.py

示例5: default_cython

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
		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,代码行数:34,代码来源:cython.py

示例6: cscan

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
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,代码行数:30,代码来源:cython.py

示例7: detect

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)

"Demo: '.coin' files are converted into cpp files using 'cat': {.coin -> .cpp -> .o}"

import TaskGen

TaskGen.declare_chain(
	name = 'copy',
	action = '${COPY} ${SRC} ${TGT}',
	ext_in = '.coin',
	ext_out = '.cpp',
	reentrant = False
)

def detect(conf):
	#dang = conf.find_program('cat', var='DANG')
	#if not dang: conf.fatal('cannot find the program "cat"')
	import os
	conf.env['COPY'] = os.getcwd() + os.sep + "cp.py"

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

示例8: decide_ext

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8

import TaskGen
def decide_ext(self,node):
	if'cxx'in self.features:return'.lex.cc'
	else:return'.lex.c'
TaskGen.declare_chain(name='flex',action='${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',ext_in='.l',decider=decide_ext,before='cc cxx',)
def detect(conf):
	flex=conf.find_program('flex',var='FLEX')
	if not flex:conf.fatal("flex was not found")
	v=conf.env
	v['FLEXFLAGS']=''

开发者ID:johnsen,项目名称:jack2,代码行数:15,代码来源:flex.py

示例9: Copyright

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
# 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,代码行数:19,代码来源:inkscape-convert.py

示例10: detect

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)

"Demo: '.coin' files are converted into cpp files using 'cat': {.coin -> .cpp -> .o}"

import TaskGen

TaskGen.declare_chain(
	name = 'dang',
	action = '${DANG} ${SRC} > ${TGT}',
	ext_in = '.coin',
	ext_out = '.cpp',
	before = 'cxx cc',
)

def detect(conf):
	dang = conf.find_program('cat', var='DANG', mandatory=True)

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

示例11: decide_ext

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/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,代码行数:30,代码来源:bison.py

示例12: init_lua

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# Sebastian Schlingmann, 2008
# Thomas Nagy, 2008 (ita)

import TaskGen
from TaskGen import taskgen, feature
from Constants import *

TaskGen.declare_chain(
    name="luac",
    rule="${LUAC} -s -o ${TGT} ${SRC}",
    ext_in=".lua",
    ext_out=".luac",
    reentrant=0,
    install="LUADIR",  # env variable
)


@taskgen
@feature("lua")
def init_lua(self):
    self.default_chmod = O755


def detect(conf):
    conf.find_program("luac", var="LUAC", mandatory=True)
开发者ID:Reilithion,项目名称:xmms2-reilithion,代码行数:29,代码来源:lua.py

示例13: decide_ext

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
# encoding: utf-8

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",
    action="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")
    if not bison:
        conf.fatal("bison was not found")
    v = conf.env
    v["BISONFLAGS"] = "-d"
开发者ID:johnsen,项目名称:jack2_bak,代码行数:32,代码来源:bison.py

示例14: configure

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
import Task
import TaskGen
from TaskGen import extension
import sys

TaskGen.declare_chain(
		name='genpy',
		rule='${PYTHON} ${SRC} > ${TGT}',
		reentrant=True,
		color='BLUE',
		ext_in='.genpy',
		ext_out='.c',
		before='c')

def configure(conf):
    conf.env['PYTHON'] = sys.executable
    conf.env['GENPY_EXT'] = ['.genpy']
    return True
开发者ID:chrippa,项目名称:xmms2,代码行数:20,代码来源:python-generator.py

示例15: init_lua

# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8

import TaskGen
from TaskGen import taskgen, feature
from Constants import *

TaskGen.declare_chain(
    name="luac", rule="${LUAC} -s -o ${TGT} ${SRC}", ext_in=".lua", ext_out=".luac", reentrant=False, install="LUADIR"
)


def init_lua(self):
    self.default_chmod = O755


def detect(conf):
    conf.find_program("luac", var="LUAC", mandatory=True)


feature("lua")(init_lua)
开发者ID:lvniqi,项目名称:secure_adhoc_network_ns-3,代码行数:23,代码来源:lua.py


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