summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bugzilla/bugzilla3.py45
1 files changed, 11 insertions, 34 deletions
diff --git a/bugzilla/bugzilla3.py b/bugzilla/bugzilla3.py
index 676d4f1..8e799c9 100644
--- a/bugzilla/bugzilla3.py
+++ b/bugzilla/bugzilla3.py
@@ -139,11 +139,14 @@ class Bugzilla32(Bugzilla3):
'private':private,
'work_time':worktime})
-# FIXME:
class RHBugzilla32(Bugzilla32):
'''Concrete implementation of the Bugzilla protocol. This one uses the
- methods provided by Red Hat's Bugzilla 3.1.4+ instance, which are supposed
- to make their way into a later upstream Bugzilla release (probably 4.0).
+ methods provided by Red Hat's Bugzilla 3.1.4+ instance, which is a superset
+ of the Bugzilla 3.2 methods. The additional methods (Bug.search, Bug.update)
+ should make their way into a later upstream Bugzilla release (probably 4.0).
+
+ Note that RHBZ3 *also* supports most of the old RHBZ methods, under the
+ 'bugzilla' namespace.
This class was written using bugzilla.redhat.com's API docs:
https://bugzilla.redhat.com/docs/en/html/api/
@@ -165,19 +168,10 @@ class RHBugzilla32(Bugzilla32):
buglist is a list of dicts describing bugs, and 'sql' contains the SQL
generated by executing the search.
'''
- # The following is true for rhbz; not sure if it's the case for BZ3.2
- #You can specify which columns/keys will be listed in the bugs by
- #setting 'column_list' in the query; otherwise the default columns are
- #used (see the list in querydefaults['default_column_list']).
return self._proxy.Bug.search(query)
#---- Methods for updating bugs.
- def _update_bug(self,id,updates):
- '''Update a single bug, specified by integer ID or (string) bug alias.
- Really just a convenience method for _update_bugs(ids=[id],updates)'''
- return self._update_bugs(ids=[id],updates=updates)
-
def _update_bugs(self,ids,updates):
'''Update the given fields with the given data in one or more bugs.
ids should be a list of integers or strings, representing bug ids or
@@ -188,6 +182,11 @@ class RHBugzilla32(Bugzilla32):
# TODO I think we need to catch XMLRPC exceptions to get
return self._proxy.Bug.update({'ids':ids,'updates':updates})
+ def _update_bug(self,id,updates):
+ '''Update a single bug, specified by integer ID or (string) bug alias.
+ Really just a convenience method for _update_bugs(ids=[id],updates)'''
+ return self._update_bugs(ids=[id],updates=updates)
+
# Eventually - when RHBugzilla is well and truly obsolete - we'll delete
# all of these methods and refactor the Base Bugzilla object so all the bug
# modification calls go through _update_bug.
@@ -287,25 +286,3 @@ class RHBugzilla32(Bugzilla32):
elif action == 'append':
update[which] = wb+' '+text
self._update_bug(id,update)
-
- # TODO: update this when the XMLRPC interface grows requestee support
- def _updateflags(self,id,flags):
- '''Updates the flags associated with a bug report.
- data should be a hash of {'flagname':'value'} pairs, like so:
- {'needinfo':'?','fedora-cvs':'+'}
- You may also add a "nomail":1 item, which will suppress email if set.
-
- NOTE: the Red Hat XMLRPC interface does not yet support setting the
- requestee (as in: needinfo from smartguy@answers.com). Alas.'''
- raise NotImplementedError, "wwoods needs to port this method."
-
- #---- Methods for working with attachments
-
- # If your bugzilla wants attachments in something other than base64, you
- # should override _attachment_encode here.
- # If your bugzilla uses non-standard paths for attachment.cgi, you'll
- # want to override _attachment_uri here.
-
- def _attachfile(self,id,**attachdata):
- raise NotImplementedError, "wwoods needs to port this method."
-