本文整理汇总了Python中mlog.bold函数的典型用法代码示例。如果您正苦于以下问题:Python bold函数的具体用法?Python bold怎么用?Python bold使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bold函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, kwargs):
Dependency.__init__(self)
self.is_found = False
self.cargs = []
self.linkargs = []
sdlconf = shutil.which('sdl2-config')
if sdlconf:
pc = subprocess.Popen(['sdl2-config', '--cflags'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
(stdo, _) = pc.communicate()
self.cargs = stdo.decode().strip().split()
pc = subprocess.Popen(['sdl2-config', '--libs'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
(stdo, _) = pc.communicate()
self.linkargs = stdo.decode().strip().split()
self.is_found = True
mlog.log('Dependency', mlog.bold('sdl2'), 'found:', mlog.green('YES'), '(%s)' % sdlconf)
return
try:
pcdep = PkgConfigDependency('sdl2', kwargs)
if pcdep.found():
self.is_found = True
self.cargs = pcdep.get_compile_args()
self.linkargs = pcdep.get_link_args()
return
except Exception:
pass
if mesonlib.is_osx():
fwdep = ExtraFrameworkDependency('sdl2', kwargs.get('required', True))
if fwdep.found():
self.is_found = True
self.cargs = fwdep.get_compile_args()
self.linkargs = fwdep.get_link_args()
return
mlog.log('Dependency', mlog.bold('sdl2'), 'found:', mlog.red('NO'))
开发者ID:gitnicotobs,项目名称:meson,代码行数:33,代码来源:dependencies.py
示例2: generate
def generate(self):
env = environment.Environment(self.source_dir, self.build_dir, self.meson_script_file, options)
mlog.initialize(env.get_log_dir())
mlog.log(mlog.bold('The Meson build system'))
mlog.log('Version:', coredata.version)
mlog.log('Source dir:', mlog.bold(app.source_dir))
mlog.log('Build dir:', mlog.bold(app.build_dir))
if env.is_cross_build():
mlog.log('Build type:', mlog.bold('cross build'))
else:
mlog.log('Build type:', mlog.bold('native build'))
b = build.Build(env)
intr = interpreter.Interpreter(b)
intr.run()
if options.backend == 'ninja':
import ninjabackend
g = ninjabackend.NinjaBackend(b, intr)
elif options.backend == 'vs2010':
import vs2010backend
g = vs2010backend.Vs2010Backend(b, intr)
elif options.backend == 'xcode':
import xcodebackend
g = xcodebackend.XCodeBackend(b, intr)
else:
raise RuntimeError('Unknown backend "%s".' % options.backend)
g.generate()
env.generating_finished()
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
pickle.dump(b, open(dumpfile, 'wb'))
开发者ID:F34140r,项目名称:meson,代码行数:29,代码来源:meson.py
示例3: __init__
def __init__(self, environment, kwargs):
Dependency.__init__(self)
self.is_found = False
self.cargs = []
self.linkargs = []
sdlconf = shutil.which("sdl2-config")
if sdlconf:
pc = subprocess.Popen(["sdl2-config", "--cflags"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
(stdo, _) = pc.communicate()
self.cargs = stdo.decode().strip().split()
pc = subprocess.Popen(["sdl2-config", "--libs"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
(stdo, _) = pc.communicate()
self.linkargs = stdo.decode().strip().split()
self.is_found = True
mlog.log("Dependency", mlog.bold("sdl2"), "found:", mlog.green("YES"), "(%s)" % sdlconf)
return
try:
pcdep = PkgConfigDependency("sdl2", kwargs)
if pcdep.found():
self.is_found = True
self.cargs = pcdep.get_compile_args()
self.linkargs = pcdep.get_link_args()
return
except Exception:
pass
if mesonlib.is_osx():
fwdep = ExtraFrameworkDependency("sdl2", kwargs.get("required", True))
if fwdep.found():
self.is_found = True
self.cargs = fwdep.get_compile_args()
self.linkargs = fwdep.get_link_args()
return
mlog.log("Dependency", mlog.bold("sdl2"), "found:", mlog.red("NO"))
开发者ID:eriknelson,项目名称:meson,代码行数:33,代码来源:dependencies.py
示例4: __init__
def __init__(self, name, fullpath=None, silent=False, search_dir=None):
self.name = name
if fullpath is not None:
if not isinstance(fullpath, list):
self.fullpath = [fullpath]
else:
self.fullpath = fullpath
else:
self.fullpath = [shutil.which(name)]
if self.fullpath[0] is None and search_dir is not None:
trial = os.path.join(search_dir, name)
suffix = os.path.splitext(trial)[-1].lower()[1:]
if mesonlib.is_windows() and (suffix == 'exe' or suffix == 'com'\
or suffix == 'bat'):
self.fullpath = [trial]
elif not mesonlib.is_windows() and os.access(trial, os.X_OK):
self.fullpath = [trial]
else:
# Now getting desperate. Maybe it is a script file that is a) not chmodded
# executable or b) we are on windows so they can't be directly executed.
try:
first_line = open(trial).readline().strip()
if first_line.startswith('#!'):
commands = first_line[2:].split('#')[0].strip().split()
if mesonlib.is_windows():
commands[0] = commands[0].split('/')[-1] # Windows does not have /usr/bin.
self.fullpath = commands + [trial]
except Exception:
pass
if not silent:
if self.found():
mlog.log('Program', mlog.bold(name), 'found:', mlog.green('YES'), '(%s)' % ' '.join(self.fullpath))
else:
mlog.log('Program', mlog.bold(name), 'found:', mlog.red('NO'))
开发者ID:itech001,项目名称:meson,代码行数:34,代码来源:dependencies.py
示例5: __init__
def __init__(self, name, fullpath=None, silent=False):
super().__init__()
self.name = name
self.fullpath = fullpath
if not silent:
if self.found():
mlog.log('Library', mlog.bold(name), 'found:', mlog.green('YES'), '(%s)' % self.fullpath)
else:
mlog.log('Library', mlog.bold(name), 'found:', mlog.red('NO'))
开发者ID:garfunkel,项目名称:meson,代码行数:9,代码来源:dependencies.py
示例6: find_external_dependency
def find_external_dependency(name, environment, kwargs):
required = kwargs.get("required", True)
if not isinstance(required, bool):
raise DependencyException('Keyword "required" must be a boolean.')
lname = name.lower()
if lname in packages:
dep = packages[lname](environment, kwargs)
if required and not dep.found():
raise DependencyException('Dependency "%s" not found' % name)
return dep
pkg_exc = None
pkgdep = None
try:
pkgdep = PkgConfigDependency(name, environment, kwargs)
if pkgdep.found():
return pkgdep
except Exception as e:
pkg_exc = e
if mesonlib.is_osx():
fwdep = ExtraFrameworkDependency(name, required)
if required and not fwdep.found():
raise DependencyException('Dependency "%s" not found' % name)
return fwdep
if pkg_exc is not None:
raise pkg_exc
mlog.log("Dependency", mlog.bold(name), "found:", mlog.red("NO"))
return pkgdep
开发者ID:eriknelson,项目名称:meson,代码行数:27,代码来源:dependencies.py
示例7: check_unknown_kwargs_int
def check_unknown_kwargs_int(self, kwargs, known_kwargs):
unknowns = []
for k in kwargs:
if not k in known_kwargs:
unknowns.append(k)
if len(unknowns) > 0:
mlog.log(mlog.bold('Warning:'), 'Unknown keyword argument(s) in target %s: %s.' %
(self.name, ', '.join(unknowns)))
开发者ID:DragoonX6,项目名称:meson,代码行数:8,代码来源:build.py
示例8: check_pkgconfig
def check_pkgconfig(self):
p = subprocess.Popen(['pkg-config', '--version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode != 0:
raise RuntimeError('Pkg-config executable not found.')
mlog.log('Found pkg-config version:', mlog.bold(out.decode().strip()),
'(%s)' % shutil.which('pkg-config'))
PkgConfigDependency.pkgconfig_found = True
开发者ID:garfunkel,项目名称:meson,代码行数:9,代码来源:dependencies.py
示例9: check_unknown_kwargs_int
def check_unknown_kwargs_int(self, kwargs, known_kwargs):
unknowns = []
for k in kwargs:
if not k in known_kwargs:
unknowns.append(k)
if len(unknowns) > 0:
mlog.log(
mlog.bold("Warning:"),
"Unknown keyword argument(s) in target %s: %s." % (self.name, ", ".join(unknowns)),
)
开发者ID:eriknelson,项目名称:meson,代码行数:10,代码来源:build.py
示例10: check_pkgconfig
def check_pkgconfig(self):
try:
p = subprocess.Popen(["pkg-config", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode == 0:
mlog.log("Found pkg-config:", mlog.bold(shutil.which("pkg-config")), "(%s)" % out.decode().strip())
PkgConfigDependency.pkgconfig_found = True
return
except Exception:
pass
PkgConfigDependency.pkgconfig_found = False
mlog.log("Found Pkg-config:", mlog.red("NO"))
开发者ID:eriknelson,项目名称:meson,代码行数:12,代码来源:dependencies.py
示例11: download
def download(self, p, packagename):
ofname = os.path.join(self.cachedir, p.get('source_filename'))
if os.path.exists(ofname):
mlog.log('Using', mlog.bold(packagename), 'from cache.')
return
srcurl = p.get('source_url')
mlog.log('Dowloading', mlog.bold(packagename), 'from', srcurl)
(srcdata, dhash) = self.get_data(srcurl)
expected = p.get('source_hash')
if dhash != expected:
raise RuntimeError('Incorrect hash for source %s:\n %s expected\n %s actual.' % (packagename, expected, dhash))
if p.has_patch():
purl = p.get('patch_url')
mlog.log('Downloading patch from', mlog.bold(purl))
(pdata, phash) = self.get_data(purl)
expected = p.get('patch_hash')
if phash != expected:
raise RuntimeError('Incorrect hash for patch %s:\n %s expected\n %s actual' % (packagename, expected, phash))
open(os.path.join(self.cachedir, p.get('patch_filename')), 'wb').write(pdata)
else:
mlog.log('Package does not require patch.')
open(ofname, 'wb').write(srcdata)
开发者ID:eriknelson,项目名称:meson,代码行数:22,代码来源:wrap.py
示例12: __init__
def __init__(self, name, subdir, kwargs):
self.name = name
self.subdir = subdir
self.dependencies = []
self.process_kwargs(kwargs)
self.extra_files = []
self.install_rpath = ''
unknowns = []
for k in kwargs:
if k not in CustomTarget.known_kwargs:
unknowns.append(k)
if len(unknowns) > 0:
mlog.log(mlog.bold('Warning:'), 'Unknown keyword arguments in target %s: %s' %
(self.name, ', '.join(unknowns)))
开发者ID:objectx,项目名称:meson,代码行数:14,代码来源:build.py
示例13: check_pkgconfig
def check_pkgconfig(self):
try:
p = subprocess.Popen(['pkg-config', '--version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode == 0:
mlog.log('Found pkg-config:', mlog.bold(shutil.which('pkg-config')),
'(%s)' % out.decode().strip())
PkgConfigDependency.pkgconfig_found = True
return
except Exception:
pass
PkgConfigDependency.pkgconfig_found = False
mlog.log('Found Pkg-config:', mlog.red('NO'))
开发者ID:itech001,项目名称:meson,代码行数:14,代码来源:dependencies.py
示例14: check_wxconfig
def check_wxconfig(self):
for wxc in ["wx-config-3.0", "wx-config"]:
try:
p = subprocess.Popen([wxc, "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode == 0:
mlog.log("Found wx-config:", mlog.bold(shutil.which(wxc)), "(%s)" % out.decode().strip())
self.wxc = wxc
WxDependency.wx_found = True
return
except Exception:
pass
WxDependency.wxconfig_found = False
mlog.log("Found wx-config:", mlog.red("NO"))
开发者ID:eriknelson,项目名称:meson,代码行数:14,代码来源:dependencies.py
示例15: check_wxconfig
def check_wxconfig(self):
for wxc in ['wx-config-3.0', 'wx-config']:
try:
p = subprocess.Popen([wxc, '--version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode == 0:
mlog.log('Found wx-config:', mlog.bold(shutil.which(wxc)),
'(%s)' % out.decode().strip())
self.wxc = wxc
WxDependency.wx_found = True
return
except Exception:
pass
WxDependency.wxconfig_found = False
mlog.log('Found wx-config:', mlog.red('NO'))
开发者ID:kylemanna,项目名称:meson,代码行数:16,代码来源:dependencies.py
示例16: __init__
def __init__(self, name, kwargs):
required = kwargs.get('required', True)
Dependency.__init__(self)
self.name = name
if PkgConfigDependency.pkgconfig_found is None:
self.check_pkgconfig()
if not PkgConfigDependency.pkgconfig_found:
raise DependencyException('Pkg-config not found.')
self.is_found = False
p = subprocess.Popen(['pkg-config', '--modversion', name], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode != 0:
mlog.log('Dependency', name, 'found:', mlog.red('NO'))
if required:
raise DependencyException('Required dependency %s not found.' % name)
self.modversion = 'none'
self.cargs = []
self.libs = []
else:
self.modversion = out.decode().strip()
mlog.log('Dependency', mlog.bold(name), 'found:', mlog.green('YES'), self.modversion)
version_requirement = kwargs.get('version', None)
if version_requirement is None:
self.is_found = True
else:
if not isinstance(version_requirement, str):
raise DependencyException('Version argument must be string.')
self.is_found = mesonlib.version_compare(self.modversion, version_requirement)
if not self.is_found and required:
raise DependencyException('Invalid version of a dependency, needed %s %s found %s.' % (name, version_requirement, self.modversion))
if not self.is_found:
return
p = subprocess.Popen(['pkg-config', '--cflags', name], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode != 0:
raise RuntimeError('Could not generate cargs for %s.' % name)
self.cargs = out.decode().split()
p = subprocess.Popen(['pkg-config', '--libs', name], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode != 0:
raise RuntimeError('Could not generate libs for %s.' % name)
self.libs = out.decode().split()
开发者ID:objectx,项目名称:meson,代码行数:47,代码来源:dependencies.py
示例17: generate
def generate(self):
env = environment.Environment(self.source_dir, self.build_dir, self.meson_script_file, self.options)
mlog.initialize(env.get_log_dir())
mlog.debug('Build started at', datetime.datetime.now().isoformat())
mlog.debug('Python binary:', sys.executable)
mlog.debug('Python system:', platform.system())
mlog.log(mlog.bold('The Meson build system'))
mlog.log('Version:', coredata.version)
mlog.log('Source dir:', mlog.bold(self.source_dir))
mlog.log('Build dir:', mlog.bold(self.build_dir))
if env.is_cross_build():
mlog.log('Build type:', mlog.bold('cross build'))
else:
mlog.log('Build type:', mlog.bold('native build'))
b = build.Build(env)
if self.options.backend == 'ninja':
import ninjabackend
g = ninjabackend.NinjaBackend(b)
elif self.options.backend == 'vs2010':
import vs2010backend
g = vs2010backend.Vs2010Backend(b)
elif self.options.backend == 'xcode':
import xcodebackend
g = xcodebackend.XCodeBackend(b)
else:
raise RuntimeError('Unknown backend "%s".' % self.options.backend)
intr = interpreter.Interpreter(b, g)
if env.is_cross_build():
mlog.log('Host machine cpu:', mlog.bold(intr.builtin['host_machine'].cpu_method([], {})))
mlog.log('Target machine cpu:', mlog.bold(intr.builtin['target_machine'].cpu_method([], {})))
mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
intr.run()
g.generate(intr)
env.generating_finished()
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
pickle.dump(b, open(dumpfile, 'wb'))
开发者ID:kylemanna,项目名称:meson,代码行数:37,代码来源:meson.py
示例18: initialize
def initialize():
mlog.log('Warning, glib compiled dependencies will not work until this upstream issue is fixed:',
mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754'))
return GnomeModule()
开发者ID:eriknelson,项目名称:meson,代码行数:4,代码来源:gnome.py
示例19: initialize
def initialize():
mlog.log('Warning, rcc dependencies will not work properly until this upstream issue is fixed:',
mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'))
return Qt4Module()
开发者ID:gitnicotobs,项目名称:meson,代码行数:4,代码来源:qt4.py
示例20: __init__
def __init__(self, environment, kwargs):
super().__init__()
self.name = 'threads'
self.is_found = True
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES'))
开发者ID:amitdo,项目名称:meson,代码行数:5,代码来源:dependencies.py
注:本文中的mlog.bold函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论