calendar/providers/gdata/makeversion.py
author Philipp Kewisch <mozilla@kewis.ch>
Thu, 14 Feb 2013 00:34:36 +0100
changeset 14855 9a7f8ded61c8437c88ab6161bba4163cfb30ffb4
parent 14159 f919289ef9c8af823168b642c42d319f299bfd8d
child 21485 a24a537854677134bc91c81498e50f1524e7dc66
permissions -rw-r--r--
Fix bug 808668 - Upgrade update.php script with new locations and re-enable automatic nightly updates by adding em:updateURL to install.rdf. r=Standard8

# 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/.

import sys
import re

# Converts a Lightning version to a matching gdata version:
#  Lightning 1.2 -> gdata-provider 0.11
#  Lightning 1.3a1 -> gdata-provider 0.12pre
v = re.search(r"(\d+\.\d+)([a-z]\d+)?", sys.argv[1])
print "{0:.2f}".format((float(v.group(1)) - 0.1)/10) + (v.lastindex == 2 and "pre" or "")