mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-05 23:01:32 +00:00
hints: support package and version properties.
Each property returns the value of the corresponding property for the first entry in the package list; this is a handy short-cut for hints where there will only ever be one package in the list (e.g. "age-days", "unblock"). Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
76a83ae527
commit
a5e448fd27
15
hints.py
15
hints.py
@ -84,3 +84,18 @@ class Hint:
|
|||||||
@property
|
@property
|
||||||
def days(self):
|
def days(self):
|
||||||
return self._days
|
return self._days
|
||||||
|
|
||||||
|
@property
|
||||||
|
def package(self):
|
||||||
|
if self.packages:
|
||||||
|
return self.packages[0].package
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def version(self):
|
||||||
|
if self.packages:
|
||||||
|
return self.packages[0].version
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user