diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-30 15:46:34 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-30 15:46:34 +0100 |
| commit | 5cc2cc92346239274953f3795f9b3d0ec5534246 (patch) | |
| tree | d9096b97878b35c3c458fac0f7c88acae3469d65 /apt | |
| parent | 38165cbeb26313bb468dcf527a843ba55571a8f2 (diff) | |
| parent | 055dc32f4025f081293cee32cde935100532c651 (diff) | |
| download | python-apt-5cc2cc92346239274953f3795f9b3d0ec5534246.tar.gz | |
GREEN: apt.Version has a "policy_priority" property
Diffstat (limited to 'apt')
| -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. |
