本文整理匯總了Python中version.Version.get_last_version_short方法的典型用法代碼示例。如果您正苦於以下問題:Python Version.get_last_version_short方法的具體用法?Python Version.get_last_version_short怎麽用?Python Version.get_last_version_short使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類version.Version
的用法示例。
在下文中一共展示了Version.get_last_version_short方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_latest_release_job_version
# 需要導入模塊: from version import Version [as 別名]
# 或者: from version.Version import get_last_version_short [as 別名]
def get_latest_release_job_version():
"""
Reads the version number off of the commcare-android job, and use it to
find the hotfix version in the latest commcare-android-X.XX job.
"""
master_xml = j.get_job_config('commcare-android')
versionPattern = re.compile(r'VERSION=(\d+).(\d+).(\d+)')
next_version_raw = versionPattern.search(master_xml).groups()
if len(next_version_raw) != 3:
raise Exception("Couldn't find next version to deploy")
next_version = Version(*map(int, next_version_raw))
last_version = next_version.get_last_version_short()
staged_release_job = 'commcare-android-{}'.format(last_version)
release_xml = j.get_job_config(staged_release_job)
current_version_raw = versionPattern.search(release_xml).groups()
if len(current_version_raw) != 3:
raise Exception("Couldn't find next version to deploy")
return Version(*map(int, current_version_raw))