blob: f99b7264f5079ade9bcdfd5b8ef0c8b70caa72a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
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"
|