rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
lst = get_fortran_tasks(bld) | lst = get_fortran_tasks(self) | def runnable_status(self): """ set the mod file outputs and the dependencies on the mod files over all the fortran tasks there are no concurrency issues since the method runnable_status is executed by the main thread """ if getattr(self, 'mod_fortran_done', None): return super(fc, self).runnable_status() |
self.archive() def archive(self): | def execute(self): | |
node = self.path.make_node(self.arch_name) | try: self.base_path except: self.base_path = self.path node = self.base_path.make_node(self.arch_name) | def execute(self): |
self.base_path except: self.base_path = self.path files = self.path.ant_glob('**/*') | files = self.files except: files = self.base_path.ant_glob('**/*') | def execute(self): |
for x in files: tinfo = tar.gettarinfo(name=x.abspath(), arcname=x.path_from(self.base_path)) tinfo.uid = 0 tinfo.gid = 0 tinfo.uname = 'root' tinfo.gname = 'root' fu = None try: fu = open(x.abspath()) tar.addfile(tinfo, fileobj=fu) finally: fu.close() | def execute(self): | |
opt.add_option('--source', action='store', default='main.c', help='space-separated list of source files', dest='progtype') | opt.add_option('--source', action='store', default='main.c', help='space-separated list of source files', dest='source') | def options(opt): opt.add_option('--target', action='store', default='program', help='type: program, shlib, stlib, objects', dest='progtype') opt.add_option('--source', action='store', default='main.c', help='space-separated list of source files', dest='progtype') opt.load('compiler_c') |
from waflib import Options | def build(bld): from waflib import Options tp = Options.options.progtype features = 'c cprogram' if tp == 'shlib': features = 'c cshlib' elif tp == 'stlib': features = 'c cstlib' elif tp == 'objects': features = 'c' source = Options.options.source bld(features=features, source=source) | |
opt = Options.OptionsContext().execute() | Options.OptionsContext().execute() | def start(cwd, version, wafdir): # no script file here Logs.init_log() Context.waf_dir = wafdir Context.out_dir = Context.top_dir = Context.run_dir = cwd Context.g_module = imp.new_module('wscript') Context.g_module.root_path = cwd Context.Context.recurse = recurse_rep Context.g_module.configure = configure Context.g_... |
for x in node.childs.values(): | for x in node.children.values(): | def enumerate(self, node): yield node.abspath() for x in node.childs.values(): if x.id & 3 == Node.DIR: for k in self.enumerate(x): yield k raise StopIteration |
ret = get_registry_app_path(Utils.winreg.HKEY_CURRENT_USER, filename) | ret = Utilsget_registry_app_path(Utils.winreg.HKEY_CURRENT_USER, filename) | def find_program(self, filename, **kw): """ Search for a program on the operating system When var is used, you may set os.environ[var] to help finding a specific program version, for example:: $ VALAC=/usr/bin/valac_test waf configure :param path_list: paths to use for searching :type param_list: list of string :par... |
ret = get_registry_app_path(Utils.winreg.HKEY_LOCAL_MACHINE, filename) | ret = Utils.get_registry_app_path(Utils.winreg.HKEY_LOCAL_MACHINE, filename) | def find_program(self, filename, **kw): """ Search for a program on the operating system When var is used, you may set os.environ[var] to help finding a specific program version, for example:: $ VALAC=/usr/bin/valac_test waf configure :param path_list: paths to use for searching :type param_list: list of string :par... |
os.write(fd, ' '.join(cmd[1:])) | os.write(fd, ' '.join(cmd[1:]).encode()) | def run(tsk): ret = tsk.generator.bld.exec_command('touch foo.txt') return ret |
for k in ['before', 'after', 'feature', 'taskgen_method', 'extension']: | excl = ['before', 'after', 'feature', 'taskgen_method', 'extension'] if x != 'ccroot': excl += ['link_task', 'stlink_task'] for k in excl: | def configure(ctx): ctx.myhelper() |
if found: | if found and not found in self.outputs: | def tryfind_header(self, filename): found = None for n in self.incpaths: found = n.find_resource(filename) if found: self.nodes.append(found) self.waiting.append(found) break if not found: if not filename in self.names: self.names.append(filename) |
detected_versions = [] | def gather_msvc_versions(conf, versions): """checks SmartPhones SDKs""" try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs') except WindowsError: try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs') exce... | |
@conf | def options(opt): opt.add_option('--junit', action='store_true', default=False, help='Run all junit tests', dest='junit') opt.add_option('--junitpath', action='store', default='', help='Give a path to the junit jar') | |
@feature('junit') @after('apply_java', 'use_javac_files') | def configure(ctx): cp = ctx.options.junitpath val = ctx.env.JUNIT_RUNNER = ctx.env.JUNIT_RUNNER or JUNIT_RUNNER if ctx.check_java_class(val, with_classpath=cp): ctx.fatal('Could not run junit from %r' % val) ctx.env.CLASSPATH_JUNIT = cp | |
fail = False | def exec_test(self): testlock.acquire() fail = False try: filename = self.inputs[0].abspath() try: fu = getattr(self.generator.bld, 'all_test_paths') except AttributeError: fu = os.environ.copy() self.generator.bld.all_test_paths = fu lst = [] for g in self.generator.bld.groups: for tg in g: link_task = getattr(tg, '... | |
filename = self.inputs[0].abspath() | bld = self.generator.bld Logs.debug("ut: %r", tup) | def exec_test(self): testlock.acquire() fail = False try: filename = self.inputs[0].abspath() try: fu = getattr(self.generator.bld, 'all_test_paths') except AttributeError: fu = os.environ.copy() self.generator.bld.all_test_paths = fu lst = [] for g in self.generator.bld.groups: for tg in g: link_task = getattr(tg, '... |
fu = getattr(self.generator.bld, 'all_test_paths') | bld.utest_results.append(tup) | def exec_test(self): testlock.acquire() fail = False try: filename = self.inputs[0].abspath() try: fu = getattr(self.generator.bld, 'all_test_paths') except AttributeError: fu = os.environ.copy() self.generator.bld.all_test_paths = fu lst = [] for g in self.generator.bld.groups: for tg in g: link_task = getattr(tg, '... |
fu = os.environ.copy() self.generator.bld.all_test_paths = fu lst = [] for g in self.generator.bld.groups: for tg in g: link_task = getattr(tg, 'link_task', None) if link_task: lst.append(link_task.outputs[0].parent.abspath()) def add_path(dct, path, var): dct[var] = os.pathsep.join(Utils.to_list(path) + [os.environ.... | bld.utest_results = [tup] | def exec_test(self): testlock.acquire() fail = False try: filename = self.inputs[0].abspath() try: fu = getattr(self.generator.bld, 'all_test_paths') except AttributeError: fu = os.environ.copy() self.generator.bld.all_test_paths = fu lst = [] for g in self.generator.bld.groups: for tg in g: link_task = getattr(tg, '... |
color = 'RED' | color = 'PINK' | def add_path(dct, path, var): dct[var] = os.pathsep.join(Utils.to_list(path) + [os.environ.get(var, '')]) |
for (f, fail, ret) in lst: col = fail and 'RED' or 'GREEN' Logs.pprint(col, (fail and 'FAIL' or 'ok') + " " + f) if fail: Logs.pprint('NORMAL', ret.replace('\\n', '\n')) | total = len(lst) tfail = len([x for x in lst if x[1]]) Logs.pprint('CYAN', ' tests that pass %d/%d' % (total-tfail, total)) for (f, code, out, err) in lst: if not code: Logs.pprint('CYAN', ' %s' % f) Logs.pprint('CYAN', ' tests that fail %d/%d' % (tfail, total)) for (f, code, out, err) in lst: if code: Logs.ppri... | def summary(bld): lst = getattr(bld, 'utest_results', []) if lst: Logs.pprint('CYAN', 'execution summary') for (f, fail, ret) in lst: col = fail and 'RED' or 'GREEN' Logs.pprint(col, (fail and 'FAIL' or 'ok') + " " + f) if fail: Logs.pprint('NORMAL', ret.replace('\\n', '\n')) |
if token in ['ifdef', 'ifndef', 'if']: state.append(undefined) elif token == 'endif': | if token == 'endif': | def process_line(self, token, line): ve = Logs.verbose if ve: debug('preproc: line is %s - %s state is %s', token, line, self.state) state = self.state |
if not token in ['else', 'elif', 'endif']: if skipped in self.state or ignored in self.state: return if token == 'if': ret = eval_macro(tokenize(line), self.defs) if ret: state[-1] = accepted else: state[-1] = ignored elif token == 'ifdef': m = re_mac.search(line) if m and m.group(0) in self.defs: state[-1] = accepted... | def process_line(self, token, line): ve = Logs.verbose if ve: debug('preproc: line is %s - %s state is %s', token, line, self.state) state = self.state | |
env['GLIB_MKENUMS_SOURCE'] = [k.srcpath() for k in source_list] | env['GLIB_MKENUMS_SOURCE'] = [k.abspath() for k in source_list] | def process_enums(self): for enum in getattr(self, 'enums_list', []): task = self.create_task('glib_mkenums') env = task.env inputs = [] # process the source source_list = self.to_list(enum['source']) if not source_list: raise Errors.WafError('missing source ' + str(enum)) source_list = [self.path.find_resource(k) fo... |
"""Required to use:: | """ Enables the *in* syntax:: | def __contains__(self, key): """Required to use:: |
The list may be modified inplace and there is no need to do:: | The list may be modified inplace and there is no need to do this afterwards:: | def _get_list_value_for_modification(self, key): """ Return a list value for further modification. |
afterwards. | def _get_list_value_for_modification(self, key): """ Return a list value for further modification. | |
self.install_task = self.bld.install_files(inst_to, self.link_task.outputs, env=self.env, chmod=self.link_task.chmod) | self.install_task = self.bld.install_files(inst_to, self.link_task.outputs[:], env=self.env, chmod=self.link_task.chmod) | def apply_link(self): """executes after process_source for collecting 'compiled_tasks' and creating a 'link_task'""" for x in self.features: if x == 'cprogram' and 'cxx' in self.features: # limited compat x = 'cxxprogram' elif x == 'cshlib' and 'cxx' in self.features: x = 'cxxshlib' if x in Task.classes: if issubclas... |
sout = conf.cmd_and_log(['cmd', '/E:on', '/V:on', '/C', batfile]) | sout = conf.cmd_and_log(['cmd', '/E:on', '/V:on', '/C', batfile.abspath()]) | def get_msvc_version(conf, compiler, version, target, vcvars): debug('msvc: get_msvc_version: ' + compiler + ' ' + version + ' ' + target + ' ...') batfile = conf.bldnode.make_node('waf-print-msvc.bat') batfile.write("""@echo off |
v['LIBDIR'] = '${PREFIX}/bin' | v['LIBDIR'] = v['PREFIX'] + r'\bin' | def msvc_common_flags(conf): v = conf.env v['DEST_BINFMT'] = 'pe' v['LIBDIR'] = '${PREFIX}/bin' v['CCFLAGS'] = v['CXXFLAGS'] = ['/nologo'] v['DEFINES_ST'] = '/D%s' v['CC_SRC_F'] = '' v['CC_TGT_F'] = ['/c', '/Fo'] v['CXX_SRC_F'] = '' v['CXX_TGT_F'] = ['/c', '/Fo'] v['CPPPATH_ST'] = '/I%s' # templa... |
debug = getattr(self, 'debug', self.env.CSDEBUG) if not debug: | csdebug = getattr(self, 'csdebug', self.env.CSDEBUG) if not csdebug: | def debug_cs(self): debug = getattr(self, 'debug', self.env.CSDEBUG) if not debug: return node = self.cs_task.outputs[0] if self.env.CS_NAME == 'mono': out = node.parent.find_or_declare(node.name + '.mdb') else: out = node.change_ext('.pdb') self.cs_task.outputs.append(out) self.install_task.source.append(out) if deb... |
if debug == 'pdbonly': | if csdebug == 'pdbonly': | def debug_cs(self): debug = getattr(self, 'debug', self.env.CSDEBUG) if not debug: return node = self.cs_task.outputs[0] if self.env.CS_NAME == 'mono': out = node.parent.find_or_declare(node.name + '.mdb') else: out = node.change_ext('.pdb') self.cs_task.outputs.append(out) self.install_task.source.append(out) if deb... |
elif debug == 'full': | elif csdebug == 'full': | def debug_cs(self): debug = getattr(self, 'debug', self.env.CSDEBUG) if not debug: return node = self.cs_task.outputs[0] if self.env.CS_NAME == 'mono': out = node.parent.find_or_declare(node.name + '.mdb') else: out = node.change_ext('.pdb') self.cs_task.outputs.append(out) self.install_task.source.append(out) if deb... |
debug('msvc: embedding manifest') | debug('msvc: embedding manifest in mode %r' % mode) print("mode is %r" % mode) | def exec_mf(self): env = self.env mtool = env['MT'] if not mtool: return 0 self.do_manifest = False outfile = self.outputs[0].abspath() manifest = None for out_node in self.outputs: if out_node.name.endswith('.manifest'): manifest = out_node.abspath() break if manifest is None: # Should never get here. If we do, it... |
path_list = kw.get('path_list', '') | def find_program(self, filename, **kw): """ Search for a program on the operating system Additional arguments in kw: * path_list: list of paths to look into * var: store the result to conf.env[var], by default use filename.upper() * ext: list of extensions for the binary (do not forget the empty extension) """ exts = ... | |
if hasattr(self, 'gir'): | if self.gir: | def _get_api_version(): api_version = getattr (Context.g_module, 'API_VERSION', None) if api_version == None: version = Context.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') cmd = ['dumpbin', '/symbols', x.abspath()] else: if self.env.DEST_BINFMT == 'pe': re_nm = re.compile(r'T\s+_(' + self.generator.export_symbols_regex + r')\b') else: re_nm = re.com... | slist = eval(x.read()) for s in slist: | def run(self): syms = {} for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') cmd = ['dumpbin', '/symbols', x.abspath()] else: if self.env.DEST_BINFMT == 'pe': #gcc uses nm, and has a preceding _ on windows re_... |
for k in 'c cc cxx winrc cprogram cxxprogram cshlib cxxshlib stlink_task qxx'.split(): | for k in 'c cxx winrc cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib qxx'.split(): | def exec_command_msvc(self, *k, **kw): "instead of quoting all the paths and keep using the shell, we can just join the options msvc is interested in" if self.env['CC_NAME'] == 'msvc': if isinstance(k[0], list): lst = [] carry = '' for a in k[0]: if len(a) == 3 and a.startswith('/F') or a == '/doc' or a[-1] == ':': car... |
exec(function_code, self.exec_dict) | exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict) | def recurse(self, dirs, name=None): """ Run user code from the supplied list of directories. The directories can be either absolute, or relative to the directory of the wscript file. @param dirs: List of directories to visit @type name: string @param name: Name of function to invoke from the wscript """ for d in Utils... |
exec(code, module.__dict__) | exec(compile(code, file_path, 'exec'), module.__dict__) | def load_module(file_path): """ Load a Python source file containing user code. @type file_path: string @param file_path: file path @return: Loaded Python module """ try: return cache_modules[file_path] except KeyError: pass module = imp.new_module(WSCRIPT_FILE) try: code = Utils.readf(file_path, m='rU') except (IOErr... |
except AttributeError: conf.fatal("Add options(opt): opt.load('compiler_cc')") | except AttributeError: conf.fatal("Add options(opt): opt.load('compiler_c')") | def configure(conf): """ for each compiler for the platform, try to configure the compiler in theory the tools should raise a configuration error if the compiler pretends to be something it is not (setting CC=icc and trying to configure gcc) """ try: test_for_compiler = conf.options.check_c_compiler except AttributeErr... |
debug('compiler_cc: %r' % e) | debug('compiler_c: %r' % e) | def configure(conf): """ for each compiler for the platform, try to configure the compiler in theory the tools should raise a configuration error if the compiler pretends to be something it is not (setting CC=icc and trying to configure gcc) """ try: test_for_compiler = conf.options.check_c_compiler except AttributeErr... |
rule(res[0], res[1], txt, **res[2]) | rule(res[0], res[1], tgt, **res[2]) | def create(tgt, *cmds, **kw) : if len(cmds) > 0 : res = cmds[0](tgt) rule(res[0], res[1], txt, **res[2]) for c in cmds[1:] : res = c(tgt) modify(res[0], tgt, res[1], **res[2]) return tgt |
def cmd(c, inputs = None, **kw) : | def cmd(c, inputs = [], **kw) : | def cmd(c, inputs = None, **kw) : def icmd(tgt) : return (c, inputs, kw) return icmd |
if getattr(self.generator, 'link_task', []).__class__.__name__.find('program') < 0: | if self.is_lib: | def run(self): env = self.env |
api_version = getattr (Utils.g_module, 'API_VERSION', None) | api_version = getattr (Context.g_module, 'API_VERSION', None) | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
version = Utils.g_module.VERSION.split(".") | version = Context.g_module.VERSION.split(".") | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
valatask.vapi_path = getattr(self, 'vapi_path', None) valatask.header_path = None | valatask.vapi_path = getattr(self, 'vapi_path', '${DATAROOTDIR}/vala/vapi') valatask.pkg_name = getattr(self, 'pkg_name', self.env['PACKAGE']) valatask.header_path = getattr(self, 'header_path', '${INCLUDEDIR}/%s-%s' % (valatask.pkg_name, _get_api_version())) valatask.is_lib = False if not 'cprogram' in self.features:... | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
valatask.header_path = getattr(self, 'header_path', '${INCLUDEDIR}/%s-%s' % (self.env['PACKAGE'], _get_api_version())) | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version | |
if hasattr(self, 'gir'): valatask.gir = self.gir features = self.features if not 'cprogram' in features: | if valatask.is_lib: | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
if valatask.attr("install_path") and ('cshlib' in features or 'cstlib' in features): | if valatask.is_lib: | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
LINKFLAGS_IGNORED = [r'-lang*', r'-lcrt[a-zA-Z0-9]*\.o', r'-lc$', r'-lSystem', r'-libmil', r'-LIST:*', r'-LNO:*'] | LINKFLAGS_IGNORED = [r'-lang*', r'-lcrt[a-zA-Z0-9\.]*\.o', r'-lc$', r'-lSystem', r'-libmil', r'-LIST:*', r'-LNO:*'] | def check_fortran_verbose_flag(self, *k, **kw): """ check what kind of -v flag works, then set it to env.FC_VERBOSE_FLAG """ self.start_msg('fortran link verbose flag') for x in ['-v', '--verbose', '-verbose', '-V']: try: self.check_cc( features = 'fc fcprogram_test', fragment = FC_FRAGMENT2, compile_filename = 'test.f... |
elif st == '-D' or st == '/D': | elif st == '-D' or (self.env.CXX_NAME == 'msvc' and st == '/D'): | def configure(conf): conf.parse_flags('-O3', uselib_store='FOO') # conf.env.CXXFLAGS_FOO = ['-O3'] # conf.env.CFLAGS_FOO = ['-O3'] |
pass | meths = [fixfeat(x) for x in meths] | def append_doc(fun, keyword, meths): if keyword == "feature": pass else: meths = [":py:func:`%s`" % x for x in meths] dc = ", ".join(meths) fun.__doc__ += '\n\t:%s: %s' % (keyword, dc) |
meths = [":py:func:`%s`" % x for x in meths] | meths = [fixmeth(x) for x in meths] | def append_doc(fun, keyword, meths): if keyword == "feature": pass else: meths = [":py:func:`%s`" % x for x in meths] dc = ", ".join(meths) fun.__doc__ += '\n\t:%s: %s' % (keyword, dc) |
from waflib.Tools import python | TaskGen.taskgen_method(TaskGen.to_nodes) TaskGen.feature('*')(TaskGen.process_source) TaskGen.feature('*')(TaskGen.process_rule) TaskGen.before('process_source')(TaskGen.process_rule) TaskGen.feature('seq')(TaskGen.sequence_order) TaskGen.extension('.pc.in')(TaskGen.add_pcfile) TaskGen.feature('subst')(TaskGen.process_... | def deco(func): setattr(task_gen, func.__name__, func) for fun_name in k: if not fun_name in task_gen.prec[func.__name__]: task_gen.prec[func.__name__].append(fun_name) fix_fun_doc(func) append_doc(func, 'after', k) return func |
self.install_vheader = [] for header in headers_list: top_src = self.bld.srcnode install_path = '%s/%s' % (valatask.header_path, header.path_from(top_src)) self.install_vheader.append(self.bld.install_as(install_path, header, self.env)) | self.install_vheader = self.bld.install_files(valatask.header_path, headers_list, self.env) | def _get_api_version(): api_version = getattr (Context.g_module, 'API_VERSION', None) if api_version == None: version = Context.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version |
def post_install(self): bld = self.generator.bld features = self.generator.features if self.attr("install_path") and ('cshlib' in features or 'cstlib' in features): headers_list = [o for o in self.outputs if o.suffix() == ".h"] vapi_list = [o for o in self.outputs if (o.suffix() in (".vapi", ".deps"))] gir_list = [o f... | def post_install(self): bld = self.generator.bld features = self.generator.features | |
self.includes.append(node.ctx.srcnode.abspath()) self.includes.append(node.ctx.bldnode.abspath()) | self.includes.append(self.bld.srcnode.abspath()) self.includes.append(self.bld.bldnode.abspath()) | def vala_file(self, node): valatask = getattr(self, "valatask", None) # there is only one vala task and it compiles all vala files .. :-/ if not valatask: valatask = self.create_task('valac') self.valatask = valatask self.includes = Utils.to_list(getattr(self, 'includes', [])) self.uselib = self.to_list(self.uselib) va... |
def set_env(self, name, val): | def set_env(self, val): | def set_env(self, name, val): """setter for the env property""" self.all_envs[name] = val |
self.all_envs[name] = val | self.all_envs['default'] = val | def set_env(self, name, val): """setter for the env property""" self.all_envs[name] = val |
def use_rec(self, name, objects=True, stlib=True): | def use_rec(self, name, **kw): | def use_rec(self, name, objects=True, stlib=True): """ process the use keyword, recursively """ if name in self.seen_libs: return else: self.seen_libs.add(name) get = self.bld.get_tgen_by_name try: y = get(name) except Errors.WafError: self.uselib.append(name) return y.post() has_link = getattr(y, 'link_task', None) ... |
self.use_rec(x, objects and not has_link, stlib and (is_static or not has_link)) | self.use_rec(x, objects=objects and not has_link, stlib=stlib and (is_static or not has_link)) | def use_rec(self, name, objects=True, stlib=True): """ process the use keyword, recursively """ if name in self.seen_libs: return else: self.seen_libs.add(name) get = self.bld.get_tgen_by_name try: y = get(name) except Errors.WafError: self.uselib.append(name) return y.post() has_link = getattr(y, 'link_task', None) ... |
path = [os.path.join(dct['PREFIX'], "libs")] | path = [os.path.join(dct['prefix'], "libs")] | def check_python_headers(conf): """Check for headers and libraries necessary to extend or embed python. On success the environment variables xxx_PYEXT and xxx_PYEMBED are added for uselib PYEXT: for compiling python extensions PYEMBED: for embedding a python interpreter""" if not conf.env['CC_NAME'] and not conf.env... |
several design possibilities: 1. get the source nodes immediately (but then the declaration order matters) 2. get the source nodes once the build has started a. and set the dependencies based on the files b. and force the installation tasks to be executed last 3. execute the installation in a post build routine For no... | def install_dir(self, path, env=None): """ create empty folders for the installation (very rarely used) TODO """ return | |
if not getattr(self, 'done_deps', None): self.done_deps = True buf = [] for x in self.source: if isinstance(x, waflib.Node.Node): y = x else: y = self.path.find_resource(x) if not y: raise Errors.WafError('could not find %r in %r' % (x, self.path)) buf.append(y) self.set_inputs(buf) bld = self.generator.bld for tsk in... | def runnable_status(self): """ installation tasks are always executed this method is executed by the main thread (so it is safe to find nodes) """ | |
p.stdin.write(b'\n') | p.stdin.write('\n') | def getoutput(conf, cmd, stdin=False): try: if stdin: stdin = subprocess.PIPE else: stdin = None p = subprocess.Popen(cmd, stdin=stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if stdin: p.stdin.write(b'\n') stdout, stderr = p.communicate() except: conf.fatal('could not determine the compiler version %r' % cmd) ... |
ext = node.suffix() try: return self.mappings[ext] except KeyError: try: return task_gen.mappings[ext] except KeyError: return None | name = node.name for k in self.mappings: if name.endswith(k): return self.mappings[k] for k in task_gen.mappings: if name.endswith(k): return task_gen.mappings[k] raise Errors.WafError("File %r has no mapping in %r (did you forget to load a waf tool?)" % (node, task_gen.mappings.keys())) | def get_hook(self, node): """ get a function able to process an extension """ ext = node.suffix() try: return self.mappings[ext] except KeyError: try: return task_gen.mappings[ext] except KeyError: return None |
x = self.get_hook(node) if not x: raise Errors.WafError("File %r has no mapping in %r (did you forget to load a waf tool?)" % (node, self.__class__.mappings.keys())) x(self, node) | self.get_hook(node)(self, node) | def process_source(self): """ Process each element in the attribute 'source', assuming it represents a list of source (a node, a string, or a list of nodes or file names) process the files by extension No error will be raised if 'self.source' is not defined. """ self.source = self.to_nodes(getattr(self, 'source', [])... |
task.env.env = {'BIBINPUTS': sr2, 'BSTINPUTS': sr2} | task.env.env = {} task.env.env.update(os.environ) task.env.env.update({'BIBINPUTS': sr2, 'BSTINPUTS': sr2}) | def tex_build(task, command='LATEX'): env = task.env bld = task.generator.bld if not env['PROMPT_LATEX']: env.append_value('LATEXFLAGS', '-interaction=batchmode') env.append_value('PDFLATEXFLAGS', '-interaction=batchmode') env.append_value('XELATEXFLAGS', '-interaction=batchmode') fun = latex_fun if command == 'PDFLA... |
for x in self.pool: x.ready.put(setq) for x in self.pool: self.get_out() for x in self.pool: put_pool(x) | try: pool = self.pool except: pass else: for x in pool: x.ready.put(setq) for x in pool: self.get_out() for x in pool: put_pool(x) self.pool = [] | def setq(consumer): consumer.ready = Queue(0) self.out.put(self) |
class nom_nom_nom(Task): def filter(self, x): lst = self.re_nm.findall(x) return lst != [] and '\n'.join(lst) or '' | class generate_sym_task(Task): | def build(ctx): ctx(features='c cshlib syms', source='a.c b.c', export_symbols_regex='mylib_.*', target='testlib') |
syms = [] | syms = {} | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) | re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') cmd = ['dumpbin', '/symbols', x.abspath()] | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
self.re_nm = re.compile(r'T\s+_(' + self.generator.export_symbols_regex + r')\b') | re_nm = re.compile(r'T\s+_(' + self.generator.export_symbols_regex + r')\b') | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
self.re_nm = re.compile(r'T\s+(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['nm', x.abspath()], quiet=STDOUT)) s and syms.append(s) | re_nm = re.compile(r'T\s+(' + self.generator.export_symbols_regex + r')\b') cmd = ['nm', '-g', x.abspath()] for s in re_nm.findall(self.generator.bld.cmd_and_log(cmd, quiet=STDOUT)): syms[s] = 1 lsyms = syms.keys() lsyms.sort() | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
self.outputs[0].write('EXPORTS\n' + '\n'.join(syms)) | self.outputs[0].write('EXPORTS\n' + '\n'.join(lsyms)) | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
self.outputs[0].write('{ global:\n' + ';\n'.join(syms) + ";\nlocal: *; };\n") | self.outputs[0].write('{ global:\n' + ';\n'.join(lsyms) + ";\nlocal: *; };\n") | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
raise NotImplemented | raise Exception('NotImplemented') | def run(self): syms = [] for x in self.inputs: if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): self.re_nm = re.compile(r'External\s+\|\s+_(' + self.generator.export_symbols_regex + r')\b') s = self.filter(self.generator.bld.cmd_and_log(['dumpbin', '/symbols', x.abspath()], quiet=STDOUT)) else: if self.generator.bld... |
lst = [self.path.find_or_declare(f) for f in self.env[CFG_FILES]] | lst = [self.root.find_or_declare(f) for f in self.env[CFG_FILES]] | def clean(self): """clean the data and some files in the build dir .. well, TODO""" Logs.debug('build: clean called') |
p.stdin.write('\n') | p.stdin.write(b'\n') | def getoutput(conf, cmd, stdin=False): try: if stdin: stdin = subprocess.PIPE else: stdin = None p = subprocess.Popen(cmd, stdin=stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if stdin: p.stdin.write('\n') stdout, stderr = p.communicate() except: conf.fatal('could not determine the compiler version %r' % cmd) e... |
gr.add_option('--target', action='store', default='program', help='type: program, shlib, stlib, objects', dest='progtype') gr.add_option('--source', action='store', default='main.c', help='space-separated list of source files', dest='progtype') | opt.add_option('--target', action='store', default='program', help='type: program, shlib, stlib, objects', dest='progtype') opt.add_option('--source', action='store', default='main.c', help='space-separated list of source files', dest='progtype') | def options(opt): gr.add_option('--target', action='store', default='program', help='type: program, shlib, stlib, objects', dest='progtype') gr.add_option('--source', action='store', default='main.c', help='space-separated list of source files', dest='progtype') opt.load('compiler_c') |
Context.Context.recurse = lambda x, y: getattr(Context.g_module, x.cmd, Utils.nada)(x) | Context.Context.recurse = recurse_rep | def start(cwd, version, wafdir): # no script file here Logs.init_log() Context.waf_dir = wafdir Context.out_dir = Context.top_dir = Context.run_dir = cwd Context.g_module = imp.new_module('wscript') Context.g_module.root_path = cwd Context.Context.recurse = lambda x, y: getattr(Context.g_module, x.cmd, Utils.nada)(x) ... |
if 'configure' in sys.argv: | def start(cwd, version, wafdir): # no script file here Logs.init_log() Context.waf_dir = wafdir Context.out_dir = Context.top_dir = Context.run_dir = cwd Context.g_module = imp.new_module('wscript') Context.g_module.root_path = cwd Context.Context.recurse = lambda x, y: getattr(Context.g_module, x.cmd, Utils.nada)(x) ... | |
if ret == Task.RUN_ME: | if ret == Task.SKIP_ME: | def runnable_status(self): ret = super(utest, self).runnable_status() if ret == Task.RUN_ME: if getattr(Options.options, 'all_tests', False): return Task.RUN_ME else: return Task.SKIP_ME return ret |
curdirnode = self.curdirnode abs = curdirnode.abspath() | def scan(self): node = self.inputs[0] env = self.env nodes = [] names = [] if not node: return (nodes, names) code = Utils.readf(node.abspath()) curdirnode = self.curdirnode abs = curdirnode.abspath() for match in re_tex.finditer(code): path = match.group('file') if path: for k in ['', '.tex', '.ltx']: # add another... | |
try: os.stat(abs+os.sep+path+k) except OSError: continue found = path+k node = curdirnode.find_resource(found) if node: nodes.append(node) | fi = node.parent.find_resource(path + k) if fi: nodes.append(fi) break | def scan(self): node = self.inputs[0] env = self.env nodes = [] names = [] if not node: return (nodes, names) code = Utils.readf(node.abspath()) curdirnode = self.curdirnode abs = curdirnode.abspath() for match in re_tex.finditer(code): path = match.group('file') if path: for k in ['', '.tex', '.ltx']: # add another... |
task.curdirnode = self.path | def apply_tex(self): if not getattr(self, 'type', None) in ['latex', 'pdflatex']: self.type = 'pdflatex' tree = self.bld outs = Utils.to_list(getattr(self, 'outs', [])) # prompt for incomplete files (else the batchmode is used) self.env['PROMPT_LATEX'] = getattr(self, 'prompt', 1) deps_lst = [] if getattr(self, 'de... | |
val = self.cmd_and_log('%s --variable=%s %s' % (kw['path'], v, kw['package']), kw).strip() | val = self.cmd_and_log(lst + ['--variable=' + v]).strip() | def exec_cfg(self, kw): # pkg-config version if 'atleast_pkgconfig_version' in kw: cmd = [kw['path'], '--atleast-pkgconfig-version=%s' % kw['atleast_pkgconfig_version']] self.cmd_and_log(cmd) if not 'okmsg' in kw: kw['okmsg'] = 'yes' return # checking for the version of a module for x in cfg_ver: y = x.replace('-', '... |
lst = [kw['path']] defi = kw.get('define_variable', None) if not defi: defi = self.env.PKG_CONFIG_DEFINES or {} for key, val in defi.items(): lst.append('--define-variable=%s=%s' % (key, val)) | def exec_cfg(self, kw): # pkg-config version if 'atleast_pkgconfig_version' in kw: cmd = [kw['path'], '--atleast-pkgconfig-version=%s' % kw['atleast_pkgconfig_version']] self.cmd_and_log(cmd) if not 'okmsg' in kw: kw['okmsg'] = 'yes' return # checking for the version of a module for x in cfg_ver: y = x.replace('-', '... | |
if kw['package']: lst.extend(Utils.to_list(kw['package'])) | def exec_cfg(self, kw): # pkg-config version if 'atleast_pkgconfig_version' in kw: cmd = [kw['path'], '--atleast-pkgconfig-version=%s' % kw['atleast_pkgconfig_version']] self.cmd_and_log(cmd) if not 'okmsg' in kw: kw['okmsg'] = 'yes' return # checking for the version of a module for x in cfg_ver: y = x.replace('-', '... | |
bgen = bld(rule = "${FONTFORGE} -lang=ff -c 'Open($1); Generate($2)' ${SRC} ${TGT}", source = srcnode, target = self.target) | bgen = bld(rule = "${FONTFORGE} -lang=ff -c 'Open($1); Generate($2)' ${SRC} ${TGT}", source = srcnode, target = self.target, name = self.target + "_ot" if not getattr(self, 'opentype', None) else self.target + "_font") | def build(self, bld) : res = {} |
version += vcvar | def gather_msvc_versions(conf, versions): """checks SmartPhones SDKs""" try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs') except WindowsError: try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs') exce... | |
pkgconfig = env['pkg-config'] or 'PKG_CONFIG_PATH=%s:%s/pkgconfig:/usr/lib/qt4/lib/pkgconfig:/opt/qt4/lib/pkgconfig:/usr/lib/qt4/lib:/opt/qt4/lib pkg-config --silence-errors' % (qtlibs, qtlibs) | if not 'PKG_CONFIG_PATH' in os.environ: os.environ['PKG_CONFIG_PATH'] = '%s:%s/pkgconfig:/usr/lib/qt4/lib/pkgconfig:/opt/qt4/lib/pkgconfig:/usr/lib/qt4/lib:/opt/qt4/lib pkg-config --silence-errors' % (qtlibs, qtlibs) pkgconfig = env['pkg-config'] or 'pkg-config' | def find_bin(lst, var): for f in lst: try: ret = self.find_program(f, path_list=paths) except self.errors.ConfigurationError: pass else: env[var]=ret break |
self.files.append(''.join(self.buf).encode()) | self.files.append(str(''.join(self.buf))) | def endElement(self, name): if name == 'file': self.files.append(''.join(self.buf).encode()) |
self.includes.extend(self.to_list(y.export_incdirs)) | lst = y.to_nodes(y.export_incdirs) self.includes.extend(lst + [x.get_src() for x in lst]) | def use_rec(self, name, objects=True, stlib=True): """ recursion sucks absolutely but we are forced to use it :-/ """ if name in self.seen_libs: return else: self.seen_libs.add(name) get = self.bld.get_tgen_by_name try: y = get(name) except Errors.WafError: self.uselib.append(name) return y.post() has_link = getattr(... |
d = self.path.find_dir(basedir) if not d: raise | if isinstance(self.basedir, self.path.__class__): srcdir_node = self.basedir else: srcdir_node = self.path.find_dir(self.basedir) if not srcdir_node: raise Errors.WafError('could not find basedir %r' % self.srcdir) | def jar_files(self): basedir = getattr(self, 'basedir', '.') destfile = getattr(self, 'destfile', 'test.jar') jaropts = getattr(self, 'jaropts', []) jarcreate = getattr(self, 'jarcreate', 'cf') d = self.path.find_dir(basedir) if not d: raise tsk = self.create_task('jar_create') tsk.set_outputs(self.path.find_or_decla... |
tsk.basedir = d | tsk.basedir = srcdir_node | def jar_files(self): basedir = getattr(self, 'basedir', '.') destfile = getattr(self, 'destfile', 'test.jar') jaropts = getattr(self, 'jaropts', []) jarcreate = getattr(self, 'jarcreate', 'cf') d = self.path.find_dir(basedir) if not d: raise tsk = self.create_task('jar_create') tsk.set_outputs(self.path.find_or_decla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.