mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 14:07:29 +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(RCBugPolicy(self.options))
|
||||
|
||||
for policy in self.policies:
|
||||
policy.register_hints(self._hint_parser)
|
||||
|
||||
@property
|
||||
def hints(self):
|
||||
return self._hint_parser.hints
|
||||
|
@ -66,6 +66,13 @@ class BasePolicy(object):
|
||||
if self.options.verbose or type in ("E", "W"):
|
||||
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):
|
||||
"""Called once to make the policy initialise any data structures
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user