| # This Source Code Form is subject to the terms of the Mozilla Public |
| # License, v. 2.0. If a copy of the MPL was not distributed with this |
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| # Prints the pre-release version suffix based on the version string |
| from __future__ import print_function |
| def get_prerelease_suffix(version): |
| """ Returns the prerelease suffix from the version string argument """ |
| return " {0} {1} {2}".format(m.group('prefix'), |
| {'a': 'Alpha', 'b': 'Beta'}[m.group('c')], |
| result, c = re.subn(r'^(?P<prefix>(\d+\.)*\d+)(?P<c>[ab])(?P<suffix>\d+)$', |
| print(get_prerelease_suffix(sys.argv[1])) |