summaryrefslogtreecommitdiffstats
path: root/bugzilla
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2008-08-15 15:38:57 -0400
committerWill Woods <wwoods@redhat.com>2008-08-15 15:38:57 -0400
commitf7f2627754bec10383cf909aa3375a2cf2a9a5f2 (patch)
tree0da7deaae28ba987a45847df1d6d366ef6247fce /bugzilla
parent470c7dc20943d09ae8c98e6d0484d77e5b1eb778 (diff)
downloadpython-bugzilla-f7f2627754bec10383cf909aa3375a2cf2a9a5f2.tar.gz
python-bugzilla-f7f2627754bec10383cf909aa3375a2cf2a9a5f2.tar.xz
python-bugzilla-f7f2627754bec10383cf909aa3375a2cf2a9a5f2.zip
Partial implementation of _updatewhiteboard
Diffstat (limited to 'bugzilla')
-rw-r--r--bugzilla/bugzilla3.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/bugzilla/bugzilla3.py b/bugzilla/bugzilla3.py
index 3fe3052..d730f68 100644
--- a/bugzilla/bugzilla3.py
+++ b/bugzilla/bugzilla3.py
@@ -242,12 +242,24 @@ class RHBugzilla32(Bugzilla32):
if mail is True, email will be generated for this change.
'''
raise NotImplementedError, "wwoods needs to port this method."
+
def _updatewhiteboard(self,id,text,which,action):
'''Update the whiteboard given by 'which' for the given bug.
performs the given action (which may be 'append',' prepend', or
- 'overwrite') using the given text.'''
- data = {'type':which,'text':text,'action':action}
- raise NotImplementedError, "wwoods needs to port this method."
+ 'overwrite') using the given text.
+
+ RHBZ3 Bug.update() only supports overwriting, so append/prepend
+ may cause two server roundtrips - one to fetch, and one to update.
+ '''
+ if not which.endswith('_whiteboard'):
+ which = which + '_whiteboard'
+ update = {}
+ if action == 'overwrite':
+ update[which] = text
+ else:
+ raise NotImplementedError, "append/prepend not supported yet"
+ self._update_bug(ids=[id],updates=update)
+
# TODO: update this when the XMLRPC interface grows requestee support
def _updateflags(self,id,flags):
'''Updates the flags associated with a bug report.