mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-23 16:31:32 +00:00
hints: Move Hint creation out of add_hints
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
948d15d536
commit
e5846fdc8b
10
hints.py
10
hints.py
@ -41,8 +41,8 @@ class HintCollection(object):
|
|||||||
(removal is None or removal == hint.packages[0].is_removal)
|
(removal is None or removal == hint.packages[0].is_removal)
|
||||||
]
|
]
|
||||||
|
|
||||||
def add_hint(self, user, hint):
|
def add_hint(self, hint):
|
||||||
self._hints.append(Hint(user, hint))
|
self._hints.append(hint)
|
||||||
|
|
||||||
|
|
||||||
class Hint(object):
|
class Hint(object):
|
||||||
@ -136,16 +136,16 @@ class Hint(object):
|
|||||||
def age_day_hint(hints, who, hint_name, new_age, *args):
|
def age_day_hint(hints, who, hint_name, new_age, *args):
|
||||||
for package in args:
|
for package in args:
|
||||||
h = [hint_name, new_age] + package.split(' ')
|
h = [hint_name, new_age] + package.split(' ')
|
||||||
hints.add_hint(who, h)
|
hints.add_hint(Hint(who, h))
|
||||||
|
|
||||||
|
|
||||||
def split_into_one_hint_per_package(hints, who, hint_name, *args):
|
def split_into_one_hint_per_package(hints, who, hint_name, *args):
|
||||||
for package in args:
|
for package in args:
|
||||||
hints.add_hint(who, [hint_name, package])
|
hints.add_hint(Hint(who, [hint_name, package]))
|
||||||
|
|
||||||
|
|
||||||
def single_hint_taking_list_of_packages(hints, who, *args):
|
def single_hint_taking_list_of_packages(hints, who, *args):
|
||||||
hints.add_hint(who, args)
|
hints.add_hint(Hint(who, args))
|
||||||
|
|
||||||
|
|
||||||
class HintParser(object):
|
class HintParser(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user