diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 14:59:23 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 14:59:23 +0100 |
| commit | 64c1ffa6310efdff6353346fe621aea10e36f2c9 (patch) | |
| tree | 7bf73141f728aa128c9cbe0e682dd1c16f742658 /apt/package.py | |
| parent | 44163ca57ac3f6311e05b1521ac03f120e67d520 (diff) | |
| parent | 6f538d96ec35e80e19f1b33cad86b9ae45da54f5 (diff) | |
| download | python-apt-64c1ffa6310efdff6353346fe621aea10e36f2c9.tar.gz | |
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt/package.py')
| -rw-r--r-- | apt/package.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apt/package.py b/apt/package.py index 81f33a8b..73f68c87 100644 --- a/apt/package.py +++ b/apt/package.py @@ -409,6 +409,17 @@ class Version(object): return self._cand.priority_str @property + def policy_priority(self): + """Return the internal policy priority as a number. + See apt_preferences(5) for more information about what it means. + """ + priority = 0 + policy = self.package._pcache._depcache.policy + for (packagefile, _) in self._cand.file_list: + priority = max(priority, policy.get_priority(packagefile)) + return priority + + @property def record(self): """Return a Record() object for this version. |
