def __init__(self, verstring): # PiSi version policy does not allow "-" in version strings. # They are special and used for build and release no separation. if verstring.count("-") > maxdashes: raise VersionException("%s is not a valid PiSi version format" % verstring) verchunks = verstring.split("-") verchunks.extend("0" * (maxdashes - verstring.count("-"))) (version, release, build) = verchunks self.comps = [] for i in util.multisplit(version, '._'): # some version strings can contain ascii chars at the # back. As an example: 2.11a # We split '11a' as two items like '11' and 'a' s = re.compile("[a-z-A-Z]$").search(i) if s: head = i[:s.start()] tail = s.group() self.comps.append(VersionItem(head)) self.comps.append(VersionItem(tail)) else: self.comps.append(VersionItem(i)) self.verstring = verstring self.release = VersionItem(release) self.build = VersionItem(build)
def __init__(self, verstring): # PiSi version policy does not allow "-" in version strings. # They are special and used for build and release no separation. if verstring.count("-") > maxdashes: raise VersionException("%s is not a valid PiSi version format" % verstring) verchunks = verstring.split("-") verchunks.extend("0" * (maxdashes - verstring.count("-"))) (version, release, build) = verchunks self.comps = [] for i in util.multisplit(version,'._'): # some version strings can contain ascii chars at the # back. As an example: 2.11a # We split '11a' as two items like '11' and 'a' s = re.compile("[a-z-A-Z]$").search(i) if s: head = i[:s.start()] tail = s.group() self.comps.append(VersionItem(head)) self.comps.append(VersionItem(tail)) else: self.comps.append(VersionItem(i)) self.verstring = verstring self.release = VersionItem(release) self.build = VersionItem(build)
def __init__(self, verstring): self.comps = [] for i in util.multisplit(verstring, '.-_'): # some version strings can contain ascii chars at the # back. As an example: 2.11a # We split '11a' as two items like '11' and 'a' s = re.compile("[a-z-A-Z]$").search(i) if s: head = i[:s.start()] tail = s.group() self.comps.append(VersionItem(head)) self.comps.append(VersionItem(tail)) else: self.comps.append(VersionItem(i)) self.verstring = verstring
def __init__(self, verstring): self.comps = [] for i in util.multisplit(verstring,'.-_'): # some version strings can contain ascii chars at the # back. As an example: 2.11a # We split '11a' as two items like '11' and 'a' s = re.compile("[a-z-A-Z]$").search(i) if s: head = i[:s.start()] tail = s.group() self.comps.append(VersionItem(head)) self.comps.append(VersionItem(tail)) else: self.comps.append(VersionItem(i)) self.verstring = verstring