本文整理匯總了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)