diff options
author | Will Woods <wwoods@redhat.com> | 2008-08-26 16:21:36 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2008-08-26 16:21:36 -0400 |
commit | e22c1f4fbfb268cf4970ae874e8d5988cb5f834f (patch) | |
tree | 8f26a2f7ec840664025bb6c37779896c193dd653 /bugzilla/base.py | |
parent | ed5255764779dbbee7d6fba22d6b24b04e7853bd (diff) | |
download | python-bugzilla-e22c1f4fbfb268cf4970ae874e8d5988cb5f834f.tar.gz python-bugzilla-e22c1f4fbfb268cf4970ae874e8d5988cb5f834f.tar.xz python-bugzilla-e22c1f4fbfb268cf4970ae874e8d5988cb5f834f.zip |
Move multicall methods to RHBugzilla, since they're RH-specific
Diffstat (limited to 'bugzilla/base.py')
-rw-r--r-- | bugzilla/base.py | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/bugzilla/base.py b/bugzilla/base.py index 6b7aa0d..eb53f46 100644 --- a/bugzilla/base.py +++ b/bugzilla/base.py @@ -55,9 +55,6 @@ class BugzillaBase(object): Be sure to set appropriate permissions on bugzillarc if you choose to store your password in it! - The methods which start with a single underscore are thin wrappers around - xmlrpc calls; those should be safe for multicall usage. - This is an abstract class; it must be implemented by a concrete subclass which actually connects the methods provided here to the appropriate methods on the bugzilla instance. @@ -220,41 +217,6 @@ class BugzillaBase(object): #---- Methods and properties with basic bugzilla info - # FIXME MultiCall support is a RHism, so this should move into rhbugzilla - def _multicall(self): - '''This returns kind of a mash-up of the Bugzilla object and the - xmlrpclib.MultiCall object. Methods you call on this object will be added - to the MultiCall queue, but they will return None. When you're ready, call - the run() method and all the methods in the queue will be run and the - results of each will be returned in a list. So, for example: - - mc = bz._multicall() - mc._getbug(1) - mc._getbug(1337) - mc._query({'component':'glibc','product':'Fedora','version':'devel'}) - (bug1, bug1337, queryresult) = mc.run() - - Note that you should only use the raw xmlrpc calls (mostly the methods - starting with an underscore). Normal getbug(), for example, tries to - return a Bug object, but with the multicall object it'll end up empty - and, therefore, useless. - - Further note that run() returns a list of raw xmlrpc results; you'll - need to wrap the output in Bug objects yourself if you're doing that - kind of thing. For example, Bugzilla.getbugs() could be implemented: - - mc = self._multicall() - for id in idlist: - mc._getbug(id) - rawlist = mc.run() - return [Bug(self,dict=b) for b in rawlist] - ''' - mc = copy.copy(self) - mc._proxy = xmlrpclib.MultiCall(self._proxy) - def run(): return mc._proxy().results - mc.run = run - return mc - def _getbugfields(self): '''IMPLEMENT ME: Get bugfields from Bugzilla.''' raise NotImplementedError @@ -366,29 +328,6 @@ class BugzillaBase(object): d = self.getcomponentsdetails(product,force_refresh) return d[component] - def _get_info(self,product=None): - '''This is a convenience method that does getqueryinfo, getproducts, - and (optionally) getcomponents in one big fat multicall. This is a bit - faster than calling them all separately. - - If you're doing interactive stuff you should call this, with the - appropriate product name, after connecting to Bugzilla. This will - cache all the info for you and save you an ugly delay later on.''' - mc = self._multicall() - mc._getqueryinfo() - mc._getproducts() - mc._getbugfields() - if product: - mc._getcomponents(product) - mc._getcomponentsdetails(product) - r = mc.run() - (self._querydata,self._querydefaults) = r.pop(0) - self._products = r.pop(0) - self._bugfields = r.pop(0) - if product: - self._components[product] = r.pop(0) - self._components_details[product] = r.pop(0) - #---- Methods for reading bugs and bug info def _getbug(self,id): |