本文整理汇总了Python中version.Version.get_next_hotfix方法的典型用法代码示例。如果您正苦于以下问题:Python Version.get_next_hotfix方法的具体用法?Python Version.get_next_hotfix怎么用?Python Version.get_next_hotfix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类version.Version
的用法示例。
在下文中一共展示了Version.get_next_hotfix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_manifest_hotfix_version
# 需要导入模块: from version import Version [as 别名]
# 或者: from version.Version import get_next_hotfix [as 别名]
def update_manifest_hotfix_version(file_contents):
versionPattern = re.compile(r'android:versionName="(\d+).(\d+).(\d+)"')
result = versionPattern.search(file_contents)
if result is None or len(result.groups()) != 3:
raise
version_raw = list(map(int, result.groups()))
version = Version(*version_raw)
current_version = 'android:versionName="{}"'.format(version)
next_version = 'android:versionName="{}"'.format(version.get_next_hotfix())
return file_contents.replace(current_version, next_version)
示例2: inc_hotfix_version_on_job
# 需要导入模块: from version import Version [as 别名]
# 或者: from version.Version import get_next_hotfix [as 别名]
def inc_hotfix_version_on_job(base_job_name, version):
"""
Bump the commcare-android VERSION build parameter of a release job by a
hotfix version.
"""
job_name = "{}-{}".format(base_job_name, version.short_string())
xml = j.get_job_config(job_name)
versionPattern = re.compile(r'VERSION=(\d+).(\d+).(\d+)')
current_version_raw = versionPattern.search(xml).groups()
if len(current_version_raw) != 3:
raise Exception("Couldn't parse version")
current_version = Version(*map(int, current_version_raw))
next_hotfix_version = current_version.get_next_hotfix()
print('changing {} version reference {} to {}'.format(job_name,
current_version,
next_hotfix_version))
xml = xml.replace("VERSION={}".format(current_version),
"VERSION={}".format(next_hotfix_version))
j.reconfig_job(job_name, xml)