From 4db1a045a0606bead191a563abc54dfa8352efe0 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 29 Aug 2012 23:26:17 -0400 Subject: Rewrite commands to use bugdirs instead of a single bugdir. The bulk of the work is in regard to XML, with new BugDir.xml and .from_xml methods to support the new entity. I also split the guts import_xml's ._run method into sub-methods to make the import logic more obvious. --- libbe/command/severity.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libbe/command/severity.py') diff --git a/libbe/command/severity.py b/libbe/command/severity.py index 67e4c38..51096a7 100644 --- a/libbe/command/severity.py +++ b/libbe/command/severity.py @@ -36,7 +36,7 @@ class Severity (libbe.command.Command): >>> io = libbe.command.StringInputOutput() >>> io.stdout = sys.stdout >>> ui = libbe.command.UserInterface(io=io) - >>> ui.storage_callbacks.set_bugdir(bd) + >>> ui.storage_callbacks.set_storage(bd.storage) >>> cmd = Severity(ui=ui) >>> bd.bug_from_uuid('a').severity @@ -66,10 +66,11 @@ class Severity (libbe.command.Command): ]) def _run(self, **params): - bugdir = self._get_bugdir() + bugdirs = self._get_bugdirs() for bug_id in params['bug-id']: - bug,dummy_comment = \ - libbe.command.util.bug_comment_from_user_id(bugdir, bug_id) + bugdir,bug,comment = ( + libbe.command.util.bugdir_bug_comment_from_user_id( + bugdirs, bug_id)) if bug.severity != params['severity']: try: bug.severity = params['severity'] @@ -82,7 +83,7 @@ class Severity (libbe.command.Command): def _long_help(self): try: # See if there are any per-tree severity configurations - bd = self._get_bugdir() + bugdirs = self._get_bugdirs() except NotImplementedError: pass # No tree, just show the defaults longest_severity_len = max([len(s) for s in libbe.bug.severity_values]) -- cgit