summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2007-09-18 10:55:29 -0400
committerWill Woods <wwoods@redhat.com>2007-09-18 10:55:29 -0400
commit56564c9c46f538a2da244ef783da927332631cc2 (patch)
tree5a0e34e4c87ec8d0a2129f8fb955af53d03829bf
parentb56e6e6551c8a6cd2120c336de7b9eca50a191e1 (diff)
downloadpython-bugzilla-56564c9c46f538a2da244ef783da927332631cc2.tar.gz
python-bugzilla-56564c9c46f538a2da244ef783da927332631cc2.tar.xz
python-bugzilla-56564c9c46f538a2da244ef783da927332631cc2.zip
move check code to setassignee, add docs
-rw-r--r--bugzilla.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/bugzilla.py b/bugzilla.py
index f7dc958..565d4c0 100644
--- a/bugzilla.py
+++ b/bugzilla.py
@@ -355,17 +355,28 @@ class Bugzilla(object):
# new_fixed_id, comment, isprivate are optional
raise NotImplementedError
- def _setassignee(self,id,assigned_to='',reporter='',qa_contact='',comment=''):
- #changeAssignment($id, $data, $username, $password)
- #data: 'assigned_to','reporter','qa_contact','comment'
- #returns: [$id, $mailresults]
+ def _setassignee(self,id,**data):
+ '''Raw xmlrpc call to set one of the assignee fields on a bug.
+ changeAssignment($id, $data, $username, $password)
+ data: 'assigned_to','reporter','qa_contact','comment'
+ returns: [$id, $mailresults]'''
+ return self._proxy.bugzilla.changeAssignment(id,data,self.user,self.password)
+
+ def setassignee(self,id,assigned_to='',reporter='',qa_contact='',comment=''):
+ '''Set any of the assigned_to, reporter, or qa_contact fields to a new
+ bugzilla account, with an optional comment, e.g.
+ setassignee(id,reporter='sadguy@brokencomputer.org',
+ assigned_to='wwoods@redhat.com')
+ setassignee(id,qa_contact='wwoods@redhat.com',comment='wwoods QA ftw')
+ You must set at least one of the three assignee fields, or this method
+ will throw a ValueError.
+ Returns [bug_id, mailresults].'''
if not assigned_to or reporter or qa_contact:
# XXX is ValueError the right thing to throw here?
raise ValueError, "You must set one of assigned_to, reporter, or qa_contact"
# empty fields are ignored, so it's OK to send 'em
- data = {'assigned_to': assigned_to, 'reporter': reporter,
- 'qa_contact': qa_contact, 'comment': comment}
- return self._proxy.bugzilla.changeAssignment(id,data,self.user,self.password)
+ return self._setassignee(id,assigned_to=assigned_to,reporter=reporter,
+ qa_contact=qa_contact,comment=comment)
def _updatedeps(self,id,deplist):
#updateDepends($bug_id,$data,$username,$password,$nodependencyemail)