From f7f2627754bec10383cf909aa3375a2cf2a9a5f2 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 15 Aug 2008 15:38:57 -0400 Subject: Partial implementation of _updatewhiteboard --- bugzilla/bugzilla3.py | 18 +++++++++++++++--- 1 file 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. -- cgit