aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/assign.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2011-04-16 13:37:17 -0400
committerW. Trevor King <wking@drexel.edu>2011-04-16 13:37:17 -0400
commit952a9472a66123ad7eccfa02ee5c76c11442ed0c (patch)
treec8e6e40bdb58de2f474478769fd0151d832b5ca5 /libbe/command/assign.py
parent4531a4ee54aa082ebc0c73982afb122d42c8d3d1 (diff)
downloadbugseverywhere-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.py15
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