12 Commits

Author SHA1 Message Date
Niels Thykier
9a7274db93 Convert all classes to "new-type" Python classes
Signed-off-by: Niels Thykier <niels@thykier.net>
2012-01-06 19:39:57 +01:00
Adam D. Barratt
a2ba758279 Hint: implement equality based on comparing string representations
This will work for "single package" hints, but should be extended to
consider "easy foo/1 bar/1" and "easy bar/1 foo/1" to be equivalent.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-14 19:13:16 +00:00
Julien Cristau
eb0498be93 Ensure package list contains exactly one item in convenience methods
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-14 18:29:43 +00:00
Adam D. Barratt
9ce1baad18 HintCollection::search(): fix "onlyactive" logic
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-10 12:50:01 +00:00
Adam D. Barratt
04a7bc6bb2 hints: rename the "hints" method to the more helpful "search".
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 20:26:36 +00:00
Adam D. Barratt
4276dbe347 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>
2011-09-04 18:58:14 +00:00
Adam D. Barratt
0af34d1629 Fix some brown paper bag bugs in the hint parsing code.
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 18:24:54 +00:00
Adam D. Barratt
483f2c502c hints: allow hints to be stringified
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 18:24:26 +00:00
Adam D. Barratt
a1838a5037 hints: fix up hint parsing code for age-days
string.split()'s second argument specifies the maximum number of times
the string should be split, not the maximum number of elements in the
result.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 17:05:35 +00:00
Adam D. Barratt
6c09b55a84 hints: allow more properties to be used for filtering the hint list
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:23:06 +00:00
Adam D. Barratt
4b395f79ad hints: export the user associated with a hint via a property
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:21:10 +00:00
Adam D. Barratt
af93264815 Add initial version of Hint/HintCollection classes.
These classes encapsulate information about individual hints, with
HintCollection providing a convenient wrapper around a set of hints.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-01 18:15:34 +00:00