From: Zooko O'Whielacronx Date: Wed, 9 May 2007 23:04:05 +0000 (-0700) Subject: manually merge recent changes to pyutil's copy of "version.py" with allmydata's copy... X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/something?a=commitdiff_plain;h=e0bedb64ea484af674688260004a945df3f8693d;p=tahoe-lafs%2Ftahoe-lafs.git manually merge recent changes to pyutil's copy of "version.py" with allmydata's copy of "version.py" --- diff --git a/src/allmydata/util/version.py b/src/allmydata/util/version.py index ef65212b..e495ff6d 100644 --- a/src/allmydata/util/version.py +++ b/src/allmydata/util/version.py @@ -71,6 +71,12 @@ class Tag(str): class Version: def __init__(self, vstring=None): + self.major = None + self.minor = None + self.micro = None + self.prereleasetag = None + self.nano = None + self.tags = None if vstring: self.parse(vstring) @@ -88,11 +94,14 @@ class Version: self.nanovernum = None self.tags = [] if estring: - self.nanovernum = estring + if '-' in estring: + (self.nano, tags,) = estring.split('-') + else: + self.nano = estring self.fullstr = str(self.strictversion) - if self.nanovernum is not None: - self.fullstr += "-" + str(self.nanovernum) + if self.nano is not None: + self.fullstr += "-" + str(self.nano) if self.tags: self.fullstr += '_'.join(self.tags) @@ -119,7 +128,7 @@ class Version: if res != 0: return res - res = cmp(self.nanovernum, other.nanovernum) + res = cmp(self.nano, other.nano) if res != 0: return res