projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d014be8
)
Implement Atom.__cmp__() so that things like list.sort() work correctly
author
Zac Medico
<zmedico@gentoo.org>
Sat, 21 Jun 2008 22:22:59 +0000
(22:22 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Sat, 21 Jun 2008 22:22:59 +0000
(22:22 -0000)
for Atom instances.
svn path=/main/trunk/; revision=10757
pym/portage/dep.py
patch
|
blob
|
history
diff --git
a/pym/portage/dep.py
b/pym/portage/dep.py
index 23b26a3cba363ff1ebe71369f4d75bd01069d381..3d3b5d954d1f4e80f325cf37b7a10d6ab18441e8 100644
(file)
--- a/
pym/portage/dep.py
+++ b/
pym/portage/dep.py
@@
-440,6
+440,15
@@
class Atom(object):
else:
self.use = None
+ def __cmp__(self, other):
+ self_str = str(self)
+ other_str = str(other)
+ if self_str == other_str:
+ return 0
+ if self_str > other_str:
+ return 1
+ return -1
+
def get_operator(mydep):
"""
Return the operator used in a depstring.