mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-14 07:48:19 +00:00
Support policies registering their own hints
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
9efe92de39
commit
d43311be03
@ -496,6 +496,9 @@ class Britney(object):
|
|||||||
self.policies.append(AgePolicy(self.options, MINDAYS))
|
self.policies.append(AgePolicy(self.options, MINDAYS))
|
||||||
self.policies.append(RCBugPolicy(self.options))
|
self.policies.append(RCBugPolicy(self.options))
|
||||||
|
|
||||||
|
for policy in self.policies:
|
||||||
|
policy.register_hints(self._hint_parser)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hints(self):
|
def hints(self):
|
||||||
return self._hint_parser.hints
|
return self._hint_parser.hints
|
||||||
|
@ -66,6 +66,13 @@ class BasePolicy(object):
|
|||||||
if self.options.verbose or type in ("E", "W"):
|
if self.options.verbose or type in ("E", "W"):
|
||||||
print("%s: [%s] - %s" % (type, time.asctime(), msg))
|
print("%s: [%s] - %s" % (type, time.asctime(), msg))
|
||||||
|
|
||||||
|
def register_hints(self, hint_parser):
|
||||||
|
"""Register new hints that this policy accepts
|
||||||
|
|
||||||
|
:param hint_parser: An instance of HintParser (see HintParser.register_hint_type)
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
def initialise(self, britney):
|
def initialise(self, britney):
|
||||||
"""Called once to make the policy initialise any data structures
|
"""Called once to make the policy initialise any data structures
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user