diff options
author | W. Trevor King <wking@drexel.edu> | 2011-04-16 13:37:17 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2011-04-16 13:37:17 -0400 |
commit | 952a9472a66123ad7eccfa02ee5c76c11442ed0c (patch) | |
tree | c8e6e40bdb58de2f474478769fd0151d832b5ca5 /libbe/command/assign.py | |
parent | 4531a4ee54aa082ebc0c73982afb122d42c8d3d1 (diff) | |
download | bugseverywhere-952a9472a66123ad7eccfa02ee5c76c11442ed0c.tar.gz |
Centralize assigned processing in parse_assigned & add assigned test to New.
Diffstat (limited to 'libbe/command/assign.py')
-rw-r--r-- | libbe/command/assign.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libbe/command/assign.py b/libbe/command/assign.py index 0b3f407..964a957 100644 --- a/libbe/command/assign.py +++ b/libbe/command/assign.py @@ -73,11 +73,7 @@ class Assign (libbe.command.Command): ]) def _run(self, **params): - assigned = params['assigned'] - if assigned == 'none': - assigned = None - elif assigned == '-': - assigned = self._get_user_id() + assigned = parse_assigned(self, params['assigned']) bugdir = self._get_bugdir() for bug_id in params['bug-id']: bug,dummy_comment = \ @@ -99,3 +95,12 @@ Special assigned strings: "-" assign the bug to yourself "none" un-assigns the bug """ + +def parse_assigned(command, assigned): + """Standard processing for the 'assigned' Argument. + """ + if assigned == 'none': + assigned = None + elif assigned == '-': + assigned = command._get_user_id() + return assigned |