summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2008-08-08 09:59:14 -0400
committerWill Woods <wwoods@redhat.com>2008-08-08 09:59:14 -0400
commit5c54609e23fca1104e195ad4755b6ca098db6759 (patch)
tree5bc00c61d796f8cf08aa31903b11bd9395f08638
parent9a6cd5b4fc096a8213bfe976bc88a7e506d7b2c5 (diff)
downloadpython-bugzilla-5c54609e23fca1104e195ad4755b6ca098db6759.tar.gz
python-bugzilla-5c54609e23fca1104e195ad4755b6ca098db6759.tar.xz
python-bugzilla-5c54609e23fca1104e195ad4755b6ca098db6759.zip
Move multicall methods into rhbugzilla, since normal bugzilla instances don't support it
-rw-r--r--bugzilla/base.py30
-rw-r--r--bugzilla/rhbugzilla.py22
2 files changed, 30 insertions, 22 deletions
diff --git a/bugzilla/base.py b/bugzilla/base.py
index 6a56fac..c9eaac9 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -396,36 +396,22 @@ class BugzillaBase(object):
def _getbug(self,id):
'''IMPLEMENT ME: Return a dict of full bug info for the given bug id'''
raise NotImplementedError
+ def _getbugs(self,idlist):
+ '''IMPLEMENT ME: Return a list of full bug dicts, one for each of the
+ given bug ids'''
+ raise NotImplementedError
def _getbugsimple(self,id):
'''IMPLEMENT ME: Return a short dict of simple bug info for the given
bug id'''
raise NotImplementedError
+ def _getbugssimple(self,idlist):
+ '''IMPLEMENT ME: Return a list of short bug dicts, one for each of the
+ given bug ids'''
+ raise NotImplementedError
def _query(self,query):
'''IMPLEMENT ME: Query bugzilla and return a list of matching bugs.'''
raise NotImplementedError
- # Multicall methods
- def _getbugs(self,idlist):
- '''Like _getbug, but takes a list of ids and returns a corresponding
- list of bug objects. Uses multicall for awesome speed.'''
- mc = self._multicall()
- for id in idlist:
- mc._getbug(id)
- raw_results = mc.run()
- del mc
- # check results for xmlrpc errors, and replace them with None
- return replace_getbug_errors_with_None(raw_results)
- def _getbugssimple(self,idlist):
- '''Like _getbugsimple, but takes a list of ids and returns a
- corresponding list of bug objects. Uses multicall for awesome speed.'''
- mc = self._multicall()
- for id in idlist:
- mc._getbugsimple(id)
- raw_results = mc.run()
- del mc
- # check results for xmlrpc errors, and replace them with None
- return replace_getbug_errors_with_None(raw_results)
-
# these return Bug objects
def getbug(self,id):
'''Return a Bug object with the full complement of bug data
diff --git a/bugzilla/rhbugzilla.py b/bugzilla/rhbugzilla.py
index 09b09a4..d19c863 100644
--- a/bugzilla/rhbugzilla.py
+++ b/bugzilla/rhbugzilla.py
@@ -74,6 +74,28 @@ class RHBugzilla(bugzilla.base.BugzillaBase):
raise xmlrpclib.Fault("Server","Could not load bug %s" % id)
else:
return r
+ # Multicall methods
+ def _getbugs(self,idlist):
+ '''Like _getbug, but takes a list of ids and returns a corresponding
+ list of bug objects. Uses multicall for awesome speed.'''
+ mc = self._multicall()
+ for id in idlist:
+ mc._getbug(id)
+ raw_results = mc.run()
+ del mc
+ # check results for xmlrpc errors, and replace them with None
+ return replace_getbug_errors_with_None(raw_results)
+ def _getbugssimple(self,idlist):
+ '''Like _getbugsimple, but takes a list of ids and returns a
+ corresponding list of bug objects. Uses multicall for awesome speed.'''
+ mc = self._multicall()
+ for id in idlist:
+ mc._getbugsimple(id)
+ raw_results = mc.run()
+ del mc
+ # check results for xmlrpc errors, and replace them with None
+ return replace_getbug_errors_with_None(raw_results)
+
def _query(self,query):
'''Query bugzilla and return a list of matching bugs.
query must be a dict with fields like those in in querydata['fields'].