summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-05-03 07:25:19 +0000
committerZac Medico <zmedico@gentoo.org>2009-05-03 07:25:19 +0000
commite93b5b529717810ce95e145bf31cacb2c059d601 (patch)
tree0610acf8451ca2514d4dd063781de7fb83ef9eda
parenta961ebe1e42fb98ca76c08ad1d8a8d5d6172e324 (diff)
downloadportage-e93b5b529717810ce95e145bf31cacb2c059d601.tar.gz
portage-e93b5b529717810ce95e145bf31cacb2c059d601.tar.bz2
portage-e93b5b529717810ce95e145bf31cacb2c059d601.zip
Simplify DepPriority.__int__() and make it consistent with __str__().
svn path=/main/trunk/; revision=13599
-rw-r--r--pym/_emerge/__init__.py38
1 files changed, 13 insertions, 25 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index baa4ef267..7c5a82324 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -945,35 +945,23 @@ class DepPriority(AbstractDepPriority):
Attributes Hardness
- not satisfied and buildtime 8
- not satisfied and runtime 7
- not satisfied and runtime_post 6
- satisfied and buildtime and rebuild 5
- satisfied and buildtime 4
- satisfied and runtime 3
- satisfied and runtime_post 2
- optional 1
- (none of the above) 0
-
- """
- if not self.satisfied:
- if self.buildtime:
- return 8
- if self.runtime:
- return 7
- if self.runtime_post:
- return 6
+ buildtime 0
+ runtime -1
+ runtime_post -2
+ optional -3
+ (none of the above) -4
+
+ """
+
if self.buildtime:
- if self.rebuild:
- return 5
- return 4
+ return 0
if self.runtime:
- return 3
+ return -1
if self.runtime_post:
- return 2
+ return -2
if self.optional:
- return 1
- return 0
+ return -3
+ return -4
def __str__(self):
if self.optional: