本文整理汇总了Python中waflib.Configure.conf.end_msg函数的典型用法代码示例。如果您正苦于以下问题:Python end_msg函数的具体用法?Python end_msg怎么用?Python end_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了end_msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_cython_version
def check_cython_version(conf, minver):
conf.start_msg("Checking cython version")
minver = tuple(minver)
import re
version_re = re.compile(r'cython\s*version\s*(?P<major>\d*)\.(?P<minor>\d*)(?:\.(?P<micro>\d*))?', re.I).search
cmd = conf.cmd_to_list(conf.env['CYTHON'])
cmd = cmd + ['--version']
from waflib.Tools import fc_config
stdout, stderr = fc_config.getoutput(conf, cmd)
if stdout:
match = version_re(stdout)
else:
match = version_re(stderr)
if not match:
conf.fatal("cannot determine the Cython version")
cy_ver = [match.group('major'), match.group('minor')]
if match.group('micro'):
cy_ver.append(match.group('micro'))
else:
cy_ver.append('0')
cy_ver = tuple([int(x) for x in cy_ver])
if cy_ver < minver:
conf.end_msg(False)
conf.fatal("cython version %s < %s" % (cy_ver, minver))
conf.end_msg(str(cy_ver))
示例2: find_at
def find_at(conf, check, what, where, **kwargs):
if not exists(where):
conf.msg("Specified path for %s" % what, "doesn't exist: %s" % where, color="RED")
return False
pkgp = os.getenv("PKG_CONFIG_PATH", "")
try:
conf.env.stash()
conf.env[what + "_HOME"] = where
conf.env.append_value('PATH', pjoin(where, "bin"))
conf.env.append_value('RPATH', pjoin(where, "lib"))
pkgconf_path = pjoin(where, "lib/pkgconfig")
conf.env.append_value('PKG_CONFIG_PATH', pkgconf_path)
conf.to_log("Pkg config path: %s" % conf.env.PKG_CONFIG_PATH)
if pkgp: pkgp = pkgp + ":"
os.environ["PKG_CONFIG_PATH"] = pkgconf_path + pkgp
conf.parse_flags("-I%s/include -L%s/lib" % (where, where),
uselib=kwargs["uselib_store"])
this_kwargs = kwargs.copy()
this_kwargs['check_path'] = where
check(**this_kwargs)
return True
except conf.errors.ConfigurationError:
raise
os.environ["PKG_CONFIG_PATH"] = pkgp
conf.end_msg("failed", color="YELLOW")
conf.env.revert()
return False
示例3: check_libdynamixel
def check_libdynamixel(conf, **kw):
required = 'required' in kw and kw.get('required', False)
includes_check = ['/usr/include', '/usr/local/include']
resibots_dir = conf.options.resibots if hasattr(conf.options, 'resibots') and conf.options.resibots else None
if resibots_dir:
includes_check = [resibots_dir + '/include'] + includes_check
if conf.options.libdynamixel:
includes_check = [conf.options.libdynamixel + '/include'] + includes_check
conf.start_msg('Checking for libdynamixel includes')
try:
res = conf.find_file('dynamixel/dynamixel.hpp', includes_check)
except:
res = False
if res:
conf.env.INCLUDES_LIBDYNAMIXEL = [os.path.expanduser(include) for include in includes_check]
conf.env.DEFINES_LIBDYNAMIXEL = ['USE_LIBDYNAMIXEL']
conf.end_msg('ok')
else:
if conf.options.libdynamixel and resibots_dir:
msg = 'not found in %s nor in %s' % (conf.options.libdynamixel, resibots_dir)
elif conf.options.libdynamixel or resibots_dir:
msg = 'not found in %s' % (conf.options.libdynamixel if conf.options.libdynamixel else resibots_dir)
else:
msg = 'not found, use --libdynamixel=/path/to/libdynamixel or --resibots=/path/to/resibots'
if required:
conf.fatal(msg)
else:
conf.end_msg(msg, 'YELLOW')
示例4: mkspec_try_flags
def mkspec_try_flags(conf, flagtype, flaglist):
"""
Tries the given list of compiler/linker flags if they are supported by the
current compiler, and returns the list of supported flags
:param flagtype: The flag type, cflags, cxxflags or linkflags
:param flaglist: The list of flags to be checked
:return: The list of supported flags
"""
ret = []
for flag in flaglist:
conf.start_msg("Checking for %s: %s" % (flagtype, flag))
try:
if flagtype == "cflags":
conf.check_cc(cflags=flag)
elif flagtype == "cxxflags":
conf.check_cxx(cxxflags=flag)
elif flagtype == "linkflags":
conf.check_cxx(linkflags=flag)
except conf.errors.ConfigurationError:
conf.end_msg("no", color="YELLOW")
else:
conf.end_msg("yes")
ret.append(flag)
return ret
示例5: find_at
def find_at(conf, check, what, where, **kwargs):
if not exists(where):
return False
pkgp = os.getenv("PKG_CONFIG_PATH", "")
try:
conf.env.stash()
conf.env[what + "_HOME"] = where
conf.env.append_value('PATH', pjoin(where, "bin"))
conf.env.append_value('RPATH', pjoin(where, "lib"))
pkgconf_path = pjoin(where, "lib/pkgconfig")
conf.env.append_value('PKG_CONFIG_PATH', pkgconf_path)
conf.to_log("Pkg config path: %s" % conf.env.PKG_CONFIG_PATH)
if pkgp: pkgp = pkgp + ":"
os.environ["PKG_CONFIG_PATH"] = pkgconf_path + pkgp
conf.parse_flags("-I{0}/include -L{0}/lib".format(where),
uselib=kwargs["uselib_store"])
check(**kwargs)
return True
except conf.errors.ConfigurationError:
os.environ["PKG_CONFIG_PATH"] = pkgp
conf.end_msg("failed", color="YELLOW")
conf.env.revert()
return False
示例6: check_eigen
def check_eigen(conf, **kw):
required = 'required' in kw and kw.get('required', False)
includes_check = ['/usr/include/eigen3', '/usr/local/include/eigen3', '/usr/include', '/usr/local/include']
resibots_dir = conf.options.resibots if hasattr(conf.options, 'resibots') and conf.options.resibots else None
if resibots_dir:
includes_check = [resibots_dir + '/include'] + includes_check
if conf.options.eigen:
includes_check = [conf.options.eigen + '/include'] + includes_check
conf.start_msg('Checking for Eigen includes')
try:
res = conf.find_file('Eigen/Core', includes_check)
except:
res = False
if res:
conf.env.INCLUDES_EIGEN = [os.path.expanduser(include) for include in includes_check]
conf.env.DEFINES_EIGEN = ['USE_EIGEN']
conf.end_msg('ok')
else:
if conf.options.eigen and resibots_dir:
msg = 'not found in %s nor in %s' % (conf.options.eigen, resibots_dir)
elif conf.options.eigen or resibots_dir:
msg = 'not found in %s' % (conf.options.eigen if conf.options.eigen else resibots_dir)
else:
msg = 'not found, use --eigen=/path/to/eigen or --resibots=/path/to/resibots'
if required:
conf.fatal(msg)
else:
conf.end_msg(msg, 'YELLOW')
示例7: check_omni_vrep
def check_omni_vrep(conf, **kw):
required = 'required' in kw and kw.get('required', False)
includes_check = ['/usr/include', '/usr/local/include']
resibots_dir = conf.options.resibots if hasattr(conf.options, 'resibots') and conf.options.resibots else None
if resibots_dir:
includes_check = [resibots_dir + '/include'] + includes_check
if conf.options.omni_vrep:
includes_check = [conf.options.omni_vrep + '/include'] + includes_check
conf.start_msg('Checking for omni_vrep includes')
try:
res = conf.find_file('omni_vrep/omnipointer.hpp', includes_check)
except:
res = False
if res:
conf.env.INCLUDES_OMNI_VREP = [os.path.expanduser(include) for include in includes_check]
conf.env.DEFINES_OMNI_VREP = ['USE_OMNI_VREP']
conf.end_msg('ok')
else:
if conf.options.omni_vrep and resibots_dir:
msg = 'not found in %s nor in %s' % (conf.options.omni_vrep, resibots_dir)
elif conf.options.omni_vrep or resibots_dir:
msg = 'not found in %s' % (conf.options.omni_vrep if conf.options.omni_vrep else resibots_dir)
else:
msg = 'not found, use --omni_vrep=/path/to/omni_vrep or --resibots=/path/to/resibots'
if required:
conf.fatal(msg)
else:
conf.end_msg(msg, 'YELLOW')
示例8: check_python_module
def check_python_module(conf,module_name):
conf.start_msg('Python module %s'%module_name)
try:
conf.cmd_and_log([conf.env['PYTHON'],'-c','import %s\nprint(1)\n'%module_name])
except:
conf.end_msg(False)
conf.fatal('Could not find the python module %r'%module_name)
conf.end_msg(True)
示例9: check_python_module
def check_python_module(conf,module_name):
conf.start_msg('Python module %s'%module_name)
try:
conf.cmd_and_log(conf.env['PYTHON']+['-c',PYTHON_MODULE_TEMPLATE%module_name])
except:
conf.end_msg(False)
conf.fatal('Could not find the python module %r'%module_name)
conf.end_msg(True)
示例10: check_python_module
def check_python_module(conf, module_name):
conf.start_msg("Python module %s" % module_name)
try:
conf.cmd_and_log(conf.env["PYTHON"] + ["-c", PYTHON_MODULE_TEMPLATE % module_name])
except:
conf.end_msg(False)
conf.fatal("Could not find the python module %r" % module_name)
conf.end_msg(True)
示例11: configure
def configure(conf):
conf.start_msg('Checking for program module')
# this does not work, since module is exported as a function on valgol:
# conf.find_program('module')
# Therfore:
if os.system('source /usr/local/Modules/current/init/bash && module purge') == 0:
conf.end_msg('module')
else:
conf.end_msg('module not found')
conf.fatal('Could not find the program module')
示例12: check_python_module
def check_python_module(conf, module_name):
"""
Check if the selected python interpreter can import the given python module.
"""
conf.start_msg('Python module %s' % module_name)
try:
conf.cmd_and_log([conf.env['PYTHON'], '-c', 'import %s\nprint(1)\n' % module_name])
except:
conf.end_msg(False)
conf.fatal('Could not find the python module %r' % module_name)
conf.end_msg(True)
示例13: configure
def configure(conf):
"""
The configure function for the bundle dependency tool
:param conf: the configuration context
"""
conf.load('wurf_dependency_resolve')
# Get the path where the bundled dependencies should be
# placed
bundle_path = expand_path(conf.options.bundle_path)
# List all the dependencies to be bundled
bundle_list = expand_bundle(conf, conf.options.bundle)
# List all the dependencies with an explicit path
explicit_list = explicit_dependencies(conf.options)
# Make sure that no dependencies were both explicitly specified
# and specified as bundled
overlap = set(bundle_list).intersection(set(explicit_list))
if len(overlap) > 0:
conf.fatal("Overlapping dependencies %r" % overlap)
conf.env['BUNDLE_DEPENDENCIES'] = dict()
# Loop over all dependencies and fetch the ones
# specified in the bundle_list
for name in bundle_list:
Utils.check_dir(bundle_path)
conf.start_msg('Resolve dependency %s' % name)
key = DEPENDENCY_CHECKOUT_KEY % name
dependency_checkout = getattr(conf.options, key, None)
dependency_path = dependencies[name].resolve(
ctx=conf,
path=bundle_path,
use_checkout=dependency_checkout)
conf.end_msg(dependency_path)
conf.env['BUNDLE_DEPENDENCIES'][name] = dependency_path
for name in explicit_list:
key = DEPENDENCY_PATH_KEY % name
dependency_path = getattr(conf.options, key)
dependency_path = expand_path(dependency_path)
conf.start_msg('User resolve dependency %s' % name)
conf.env['BUNDLE_DEPENDENCIES'][name] = dependency_path
conf.end_msg(dependency_path)
示例14: check_sdl
def check_sdl(conf):
conf.start_msg('Checking for SDL (1.2 - sdl-config)')
try:
conf.check_cfg(path='sdl-config', args='--cflags --libs', package='', uselib_store='SDL')
except:
conf.end_msg('sdl-config not found', 'RED')
return 1
conf.end_msg('ok')
conf.env.DEFINES_SDL += ['USE_SDL']
return 1
示例15: check_numpy_version
def check_numpy_version(conf, minver, maxver=None):
conf.start_msg("Checking numpy version")
minver = tuple(minver)
if maxver: maxver = tuple(maxver)
(np_ver_str,) = conf.get_python_variables(
['numpy.version.short_version'], ['import numpy'])
np_ver = tuple([int(x) for x in np_ver_str.split('.')])
if np_ver < minver or (maxver and np_ver > maxver):
conf.end_msg(False)
conf.fatal("numpy version %s is not in the "
"range of supported versions: minimum=%s, maximum=%s" % (np_ver_str, minver, maxver))
conf.end_msg(str(np_ver))