[yum-cvs] yum/yum packages.py,1.52,1.53
Seth Vidal
skvidal at linux.duke.edu
Tue Aug 22 17:55:02 UTC 2006
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv4364/yum
Modified Files:
packages.py
Log Message:
condense down the rich comparison methods
Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- packages.py 22 Aug 2006 04:04:50 -0000 1.52
+++ packages.py 22 Aug 2006 17:55:00 -0000 1.53
@@ -184,55 +184,37 @@
self.licenses = []
def __lt__(self, other):
- val = False
- rc = comparePoEVR(self, other)
- if rc < 0:
- val = True
-
- return val
+ if comparePoEVR(self, other) < 0:
+ return True
+ return False
+
def __gt__(self, other):
- val = False
- rc = comparePoEVR(self, other)
- if rc > 0:
- val = True
-
- return val
+ if comparePoEVR(self, other) > 0:
+ return True
+ return False
def __le__(self, other):
- val = False
- rc = comparePoEVR(self, other)
- if rc <= 0:
- val = True
-
- return val
-
+ if comparePoEVR(self, other) <= 0:
+ return True
+ return False
def __ge__(self, other):
- val = False
- rc = comparePoEVR(self, other)
- if rc >= 0:
- val = True
-
- return val
+ if comparePoEVR(self, other) >= 0:
+ return True
+ return False
def __eq__(self, other):
- val = False
- rc = comparePoEVR(self, other)
- if rc == 0:
- val = True
-
- return val
+ if comparePoEVR(self, other) == 0:
+ return True
+ return False
-
def __ne__(self, other):
- val = False
- rc = comparePoEVR(self, other)
- if rc != 0:
- val = True
-
- return val
+ if comparePoEVR(self, other) != 0:
+ return True
+ return False
+
def __hash__(self):
mystr = '%s - %s:%s-%s-%s.%s' % (self.repoid, self.epoch, self.name,
More information about the Yum-cvs-commits
mailing list