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>
debian
Adam D. Barratt 13 years ago
parent 76a83ae527
commit a5e448fd27

@ -84,3 +84,18 @@ class Hint:
@property
def days(self):
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…
Cancel
Save