diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-06-22 16:43:52 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-06-22 16:43:52 +0000 |
commit | d057d91f391981fb0564873c471d550f2f62edf5 (patch) | |
tree | d6cd416fc5e9389806ec98a02ae236c99e876e4b /pym/_emerge/DepPriority.py | |
parent | 28184c982a0688ed9bc4d82df407d4e400f6318c (diff) | |
download | portage-d057d91f391981fb0564873c471d550f2f62edf5.tar.gz portage-d057d91f391981fb0564873c471d550f2f62edf5.tar.bz2 portage-d057d91f391981fb0564873c471d550f2f62edf5.zip |
Bug #275047 - Split _emerge/__init__.py into smaller pieces. Thanks to
Sebastian Mingramm (few) <s.mingramm@gmx.de> for this patch.
svn path=/main/trunk/; revision=13663
Diffstat (limited to 'pym/_emerge/DepPriority.py')
-rw-r--r-- | pym/_emerge/DepPriority.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pym/_emerge/DepPriority.py b/pym/_emerge/DepPriority.py new file mode 100644 index 000000000..d094cd043 --- /dev/null +++ b/pym/_emerge/DepPriority.py @@ -0,0 +1,44 @@ +from _emerge.AbstractDepPriority import AbstractDepPriority +class DepPriority(AbstractDepPriority): + + __slots__ = ("satisfied", "optional", "rebuild") + + def __int__(self): + """ + Note: These priorities are only used for measuring hardness + in the circular dependency display via digraph.debug_print(), + and nothing more. For actual merge order calculations, the + measures defined by the DepPriorityNormalRange and + DepPrioritySatisfiedRange classes are used. + + Attributes Hardness + + buildtime 0 + runtime -1 + runtime_post -2 + optional -3 + (none of the above) -4 + + """ + + if self.buildtime: + return 0 + if self.runtime: + return -1 + if self.runtime_post: + return -2 + if self.optional: + return -3 + return -4 + + def __str__(self): + if self.optional: + return "optional" + if self.buildtime: + return "buildtime" + if self.runtime: + return "runtime" + if self.runtime_post: + return "runtime_post" + return "soft" + |