diff options
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" + |