1 """Handles versioning of software packages
2
3 Author: Dave Malcolm <dmalcolm@redhat.com>"""
4 __author__ = 'Dave Malcolm <dmalcolm@redhat.com>'
5
6
8
9 """
10 Class representing a version of a software package.
11 Stored internally as a list of subversions, from major to minor.
12 Overloaded comparison operators ought to work sanely.
13 """
14
16 self.versionList = versionList
17
19 """
20 Parse a string of the form number.number.number
21 """
22 return Version(map(int, versionString.split(".")))
23 fromString = staticmethod(fromString)
24
26 return ".".join(map(str, self.versionList))
27
29 tmpList = list(self.versionList)
30
31 while len(tmpList) < 5:
32 tmpList += [0]
33
34 num = 0
35 for i in range(len(tmpList)):
36 num *= 1000
37 num += tmpList[i]
38 return num
39
42
45
48
51
54
57