diff options
author | fuzzyray <fuzzyray@gentoo.org> | 2009-12-10 15:21:04 +0000 |
---|---|---|
committer | fuzzyray <fuzzyray@gentoo.org> | 2009-12-10 15:21:04 +0000 |
commit | 5fe3381eba19698f3f75f4c9628aac3eb2d765ff (patch) | |
tree | cabd67acec6e9efc605f70f17a7434b7068cca37 /pym/gentoolkit/cpv.py | |
parent | Merge rev 119 from genscripts repository which contains the first cut at maki... (diff) | |
download | gentoolkit-5fe3381eba19698f3f75f4c9628aac3eb2d765ff.tar.gz gentoolkit-5fe3381eba19698f3f75f4c9628aac3eb2d765ff.tar.bz2 gentoolkit-5fe3381eba19698f3f75f4c9628aac3eb2d765ff.zip |
Merge with rev 120 from the genscripts repo
svn path=/trunk/gentoolkit/; revision=712
Diffstat (limited to 'pym/gentoolkit/cpv.py')
-rw-r--r-- | pym/gentoolkit/cpv.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py index 7dc54e5..e5b4a48 100644 --- a/pym/gentoolkit/cpv.py +++ b/pym/gentoolkit/cpv.py @@ -99,7 +99,21 @@ class CPV(object): raise TypeError("other isn't of %s type, is %s" % ( self.__class__, other.__class__) ) - return not self < other and not self == other + return not self <= other + + def __le__(self, other): + if not isinstance(other, self.__class__): + raise TypeError("other isn't of %s type, is %s" % ( + self.__class__, other.__class__) + ) + return self < other or self == other + + def __ge__(self, other): + if not isinstance(other, self.__class__): + raise TypeError("other isn't of %s type, is %s" % ( + self.__class__, other.__class__) + ) + return self > other or self == other def __repr__(self): return "<%s %r>" % (self.__class__.__name__, str(self)) |