From 76a83ae527db061423bdbb349227fef16d7ce8dc Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Sun, 4 Sep 2011 18:24:54 +0000 Subject: [PATCH] Fix some brown paper bag bugs in the hint parsing code. Signed-off-by: Adam D. Barratt --- britney.py | 4 ++-- hints.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index 5e916cd..2f144dd 100755 --- a/britney.py +++ b/britney.py @@ -796,7 +796,7 @@ class Britney: continue elif l[0] in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove"]: for package in l[1:]: - hints.add_hint('%s %s"' % (l[0], package), who) + hints.add_hint('%s %s' % (l[0], package), who) elif l[0] in ["age-days"]: for package in l[2:]: hints.add_hint('%s %s %s' % (l[0], l[1], package), who) @@ -1590,7 +1590,7 @@ class Britney: upgrade_me.append("-%s" % (src)) excuse = Excuse("-%s" % (src)) excuse.set_vers(tsrcv, None) - excuse.addhtml("Removal request by %s" % (item.packages[0].user)) + excuse.addhtml("Removal request by %s" % (item.user)) excuse.addhtml("Package is broken, will try to remove") self.excuses.append(excuse) diff --git a/hints.py b/hints.py index e893ce2..de03786 100644 --- a/hints.py +++ b/hints.py @@ -54,6 +54,9 @@ class Hint: else: self._days, self._packages = self._packages.split(' ', 1) + if isinstance(self._packages, str): + self._packages = self._packages.split(' ') + self._packages = [HintItem(x) for x in self._packages] def set_active(self, active): @@ -77,3 +80,7 @@ class Hint: @property def user(self): return self._user + + @property + def days(self): + return self._days