本文整理汇总了Python中waflib.Configure.conf.start_msg函数的典型用法代码示例。如果您正苦于以下问题:Python start_msg函数的具体用法?Python start_msg怎么用?Python start_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了start_msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_libcmaes
def check_libcmaes(conf):
if conf.options.libcmaes:
includes_check = [conf.options.libcmaes + '/include']
libs_check = [conf.options.libcmaes + '/lib']
else:
includes_check = ['/usr/local/include', '/usr/include']
libs_check = ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu/']
incl = ''
try:
conf.start_msg('Checking for libcmaes includes (optional)')
res = conf.find_file('libcmaes/cmaes.h', includes_check)
incl = res[:-len('libcmaes/cmaes.h')-1]
conf.end_msg(incl)
except:
conf.end_msg('Not found in %s' % str(includes_check), 'YELLOW')
return 1
conf.start_msg('Checking for libcmaes libs (optional)')
lib_path = ''
for lib in ['libcmaes.so', 'libcmaes.a', 'libcmaes.dylib']:
try:
res = conf.find_file(lib, libs_check)
lib_path = res[:-len(lib)-1]
except:
continue
if lib_path == '':
conf.end_msg('Not found in %s' % str(libs_check), 'YELLOW')
return 1
else:
conf.end_msg(lib_path)
conf.env.INCLUDES_LIBCMAES = [incl]
conf.env.LIBPATH_LIBCMAES = [lib_path]
conf.env.DEFINES_LIBCMAES = ['USE_LIBCMAES']
conf.env.LIB_LIBCMAES= ['cmaes']
return 1
示例2: 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))
示例3: check_python_module
def check_python_module(conf,module_name,condition=''):
msg="Checking for python module '%s'"%module_name
if condition:
msg='%s (%s)'%(msg,condition)
conf.start_msg(msg)
try:
ret=conf.cmd_and_log(conf.env['PYTHON']+['-c',PYTHON_MODULE_TEMPLATE%module_name])
except Exception:
conf.end_msg(False)
conf.fatal('Could not find the python module %r'%module_name)
ret=ret.strip()
if condition:
conf.end_msg(ret)
if ret=='unknown version':
conf.fatal('Could not check the %s version'%module_name)
from distutils.version import LooseVersion
def num(*k):
if isinstance(k[0],int):
return LooseVersion('.'.join([str(x)for x in k]))
else:
return LooseVersion(k[0])
d={'num':num,'ver':LooseVersion(ret)}
ev=eval(condition,{},d)
if not ev:
conf.fatal('The %s version does not satisfy the requirements'%module_name)
else:
if ret=='unknown version':
conf.end_msg(True)
else:
conf.end_msg(ret)
示例4: check_nlopt
def check_nlopt(conf):
if conf.options.nlopt:
includes_check = [conf.options.nlopt + '/include']
libs_check = [conf.options.nlopt + '/lib']
else:
includes_check = ['/usr/local/include', '/usr/include']
libs_check = ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu/']
if 'RESIBOTS_DIR' in os.environ:
includes_check = [os.environ['RESIBOTS_DIR'] + '/include'] + includes_check
libs_check = [os.environ['RESIBOTS_DIR'] + '/lib'] + libs_check
try:
conf.start_msg('Checking for NLOpt includes')
res = conf.find_file('nlopt.hpp', includes_check)
conf.end_msg('ok')
except:
conf.end_msg('Not found', 'RED')
return 1
conf.start_msg('Checking for NLOpt libs')
found = False
for lib in ['libnlopt_cxx.so', 'libnlopt_cxx.a', 'libnlopt_cxx.dylib']:
try:
found = found or conf.find_file(lib, libs_check)
except:
continue
if not found:
conf.end_msg('Not found', 'RED')
return 1
else:
conf.end_msg('ok')
conf.env.INCLUDES_NLOPT = includes_check
conf.env.LIBPATH_NLOPT = libs_check
conf.env.DEFINES_NLOPT = ['USE_NLOPT']
conf.env.LIB_NLOPT = ['nlopt_cxx']
return 1
示例5: check_hexapod_controller
def check_hexapod_controller(conf):
includes_check = ['/usr/local/include', '/usr/include']
libs_check = ['/usr/local/lib', '/usr/lib']
if 'RESIBOTS_DIR' in os.environ:
includes_check = [os.environ['RESIBOTS_DIR'] + '/include'] + includes_check
libs_check = [os.environ['RESIBOTS_DIR'] + '/lib'] + libs_check
if conf.options.controller:
includes_check = [conf.options.controller + '/include']
libs_check = [conf.options.controller + '/lib']
try:
conf.start_msg('Checking for hexapod_controller includes')
res = conf.find_file('hexapod_controller/hexapod_controller_simple.hpp', includes_check)
conf.end_msg('ok')
conf.start_msg('Checking for hexapod_controller libs')
res = res and conf.find_file('libhexapod_controller_simple.a', libs_check)
conf.end_msg('ok')
conf.env.INCLUDES_HEXAPOD_CONTROLLER = includes_check
conf.env.STLIBPATH_HEXAPOD_CONTROLLER = libs_check
conf.env.STLIB_HEXAPOD_CONTROLLER = ['hexapod_controller_simple']
except:
conf.end_msg('Not found', 'RED')
return
return 1
示例6: 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')
示例7: check_python_module
def check_python_module(conf, module_name, condition=""):
msg = "Checking for python module '%s'" % module_name
if condition:
msg = "%s (%s)" % (msg, condition)
conf.start_msg(msg)
try:
ret = conf.cmd_and_log(conf.env["PYTHON"] + ["-c", PYTHON_MODULE_TEMPLATE % module_name])
except Exception:
conf.end_msg(False)
conf.fatal("Could not find the python module %r" % module_name)
ret = ret.strip()
if condition:
conf.end_msg(ret)
if ret == "unknown version":
conf.fatal("Could not check the %s version" % module_name)
from distutils.version import LooseVersion
def num(*k):
if isinstance(k[0], int):
return LooseVersion(".".join([str(x) for x in k]))
else:
return LooseVersion(k[0])
d = {"num": num, "ver": LooseVersion(ret)}
ev = eval(condition, {}, d)
if not ev:
conf.fatal("The %s version does not satisfy the requirements" % module_name)
else:
if ret == "unknown version":
conf.end_msg(True)
else:
conf.end_msg(ret)
示例8: 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')
示例9: 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
示例10: 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')
示例11: check_libcmaes
def check_libcmaes(conf):
if conf.options.libcmaes:
includes_check = [conf.options.libcmaes + '/include']
libs_check = [conf.options.libcmaes + '/lib']
else:
includes_check = ['/usr/local/include', '/usr/include']
libs_check = ['/usr/local/lib', '/usr/lib']
try:
conf.start_msg('Checking for libcmaes includes')
res = conf.find_file('libcmaes/cmaes.h', includes_check)
conf.end_msg('ok')
except:
conf.end_msg('Not found', 'RED')
return 1
conf.start_msg('Checking for libcmaes libs')
found = False
for lib in ['libcmaes.so', 'libcmaes.a', 'libcmaes.dylib']:
try:
found = found or conf.find_file(lib, libs_check)
except:
continue
if not found:
conf.end_msg('Not found', 'RED')
return 1
else:
conf.end_msg('ok')
conf.env.INCLUDES_LIBCMAES = includes_check
conf.env.LIBPATH_LIBCMAES = libs_check
conf.env.DEFINES_LIBCMAES = ['USE_LIBCMAES']
conf.env.LIB_LIBCMAES= ['cmaes']
return 1
示例12: 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)
示例13: 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)
示例14: 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)
示例15: 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')