本文整理汇总了Python中waflib.Utils.num2ver方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.num2ver方法的具体用法?Python Utils.num2ver怎么用?Python Utils.num2ver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Utils
的用法示例。
在下文中一共展示了Utils.num2ver方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_waf_version
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import num2ver [as 别名]
def check_waf_version(self,mini='1.6.99',maxi='1.8.0'):
self.start_msg('Checking for waf version in %s-%s'%(str(mini),str(maxi)))
ver=Context.HEXVERSION
if Utils.num2ver(mini)>ver:
self.fatal('waf version should be at least %r (%r found)'%(Utils.num2ver(mini),ver))
if Utils.num2ver(maxi)<ver:
self.fatal('waf version should be at most %r (%r found)'%(Utils.num2ver(maxi),ver))
self.end_msg('ok')
示例2: check_waf_version
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import num2ver [as 别名]
def check_waf_version(self, mini="1.6.99", maxi="1.8.0"):
self.start_msg("Checking for waf version in %s-%s" % (str(mini), str(maxi)))
ver = Context.HEXVERSION
if Utils.num2ver(mini) > ver:
self.fatal("waf version should be at least %r (%r found)" % (Utils.num2ver(mini), ver))
if Utils.num2ver(maxi) < ver:
self.fatal("waf version should be at most %r (%r found)" % (Utils.num2ver(maxi), ver))
self.end_msg("ok")
示例3: _check_min_version
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import num2ver [as 别名]
def _check_min_version(cfg):
cfg.start_msg('Checking cmake version')
cmd = cfg.env.get_flat('CMAKE'), '--version'
out = cfg.cmd_and_log(cmd, quiet=Context.BOTH)
m = re.search(r'\d+\.\d+(\.\d+(\.\d+)?)?', out)
if not m:
cfg.end_msg(
'unable to parse version, build is not guaranteed to succeed',
color='YELLOW',
)
else:
version = Utils.num2ver(m.group(0))
minver_str = cfg.env.get_flat('CMAKE_MIN_VERSION')
minver = Utils.num2ver(minver_str)
if version < minver:
cfg.fatal('cmake must be at least at version %s' % minver_str)
cfg.end_msg(m.group(0))
示例4: check_waf_version
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import num2ver [as 别名]
def check_waf_version(self, mini='1.7.99', maxi='1.9.0', **kw):
"""
Raise a Configuration error if the Waf version does not strictly match the given bounds::
conf.check_waf_version(mini='1.8.0', maxi='1.9.0')
:type mini: number, tuple or string
:param mini: Minimum required version
:type maxi: number, tuple or string
:param maxi: Maximum allowed version
"""
self.start_msg('Checking for waf version in %s-%s' % (str(mini), str(maxi)), **kw)
ver = Context.HEXVERSION
if Utils.num2ver(mini) > ver:
self.fatal('waf version should be at least %r (%r found)' % (Utils.num2ver(mini), ver))
if Utils.num2ver(maxi) < ver:
self.fatal('waf version should be at most %r (%r found)' % (Utils.num2ver(maxi), ver))
self.end_msg('ok', **kw)
示例5: check_waf_version
# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import num2ver [as 别名]
def check_waf_version(self, mini='1.6.0', maxi='1.7.0'):
"""
check for the waf version
Versions should be supplied as hex. 0x01000000 means 1.0.0,
0x010408 means 1.4.8, etc.
:type mini: number, tuple or string
:param mini: Minimum required version
:type maxi: number, tuple or string
:param maxi: Maximum allowed version
"""
self.start_msg('Checking for waf version in %s-%s' % (str(mini), str(maxi)))
ver = Context.HEXVERSION
if Utils.num2ver(mini) > ver:
self.fatal('waf version should be at least %r (%r found)' % (Utils.num2ver(mini), ver))
if Utils.num2ver(maxi) < ver:
self.fatal('waf version should be at most %r (%r found)' % (Utils.num2ver(maxi), ver))
self.end_msg('ok')