Allow comparing Version objects with strings
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2010-02-05 Fatih Aşıcı <fatih@pardus.org.tr>
|
||||||
|
* pisi/version.py (compare): Allow comparing Version objects
|
||||||
|
with strings.
|
||||||
|
|
||||||
2010-02-04 Ozan Çağlayan <ozan@pardus.org.tr>
|
2010-02-04 Ozan Çağlayan <ozan@pardus.org.tr>
|
||||||
* pisi/pxml/autoxml.py (format): Some optional elements may be None
|
* pisi/pxml/autoxml.py (format): Some optional elements may be None
|
||||||
during formatting, handle those situations. We still have a formatting
|
during formatting, handle those situations. We still have a formatting
|
||||||
|
|||||||
@@ -182,6 +182,10 @@ class Version:
|
|||||||
not we use the comparison operator. And we iterate to the left.
|
not we use the comparison operator. And we iterate to the left.
|
||||||
The result is, 0 if two are equal, -1 if self < rhs, and +1
|
The result is, 0 if two are equal, -1 if self < rhs, and +1
|
||||||
if self>rhs"""
|
if self>rhs"""
|
||||||
|
|
||||||
|
if isinstance(ver, basestring):
|
||||||
|
ver = pisi.version.Version(ver)
|
||||||
|
|
||||||
lhs = self.comps
|
lhs = self.comps
|
||||||
rhs = ver.comps
|
rhs = ver.comps
|
||||||
# pad the short version string with zeros
|
# pad the short version string with zeros
|
||||||
|
|||||||
Reference in New Issue
Block a user