summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Woods <wwoods@wills-mini.localdomain>2007-09-06 20:54:57 -0400
committerWill Woods <wwoods@wills-mini.localdomain>2007-09-06 20:54:57 -0400
commit878fb24657c21766f778f9ea773b2306233f3559 (patch)
tree5847a36b5ac0f61339328a14e3340c4874e32475
parent4afdcd4f75effdd5f55e39916289707d7f67c235 (diff)
downloadpython-bugzilla-878fb24657c21766f778f9ea773b2306233f3559.tar.gz
python-bugzilla-878fb24657c21766f778f9ea773b2306233f3559.tar.xz
python-bugzilla-878fb24657c21766f778f9ea773b2306233f3559.zip
be a bit clearer about getbug/getbugfull
-rw-r--r--bugzilla.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/bugzilla.py b/bugzilla.py
index 31bc21a..85267b7 100644
--- a/bugzilla.py
+++ b/bugzilla.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# bugzilla.py - a Python interface to Bugzilla, using xmlrpclib.
+# bugzilla.py - a Python interface to bugzilla.redhat.com, using xmlrpclib.
#
# Copyright (C) 2007 Red Hat Inc.
# Author: Will Woods <wwoods@redhat.com>
@@ -130,25 +130,12 @@ class Bugzilla(object):
#---- Methods for reading bugs and bug info
# Return raw dicts
- def _getbug(self,id):
+ def _getbugfull(self,id):
'''Return a dict of full bug info for the given bug id'''
return self._proxy.bugzilla.getBug(id, self.user, self.password)
- def _getbugsimple(self,id):
+ def _getbug(self,id):
'''Return a short dict of simple bug info for the given bug id'''
return self._proxy.bugzilla.getBugSimple(id, self.user, self.password)
-
- # these return a Bug objects
- def getbugfull(self,id):
- '''Return a Bug object with the full complement of bug data
- already loaded.'''
- r = self._proxy.bugzilla.getBug(id, self.user, self.password)
- return Bug(bugzilla=self,dict=r)
-
- def getbug(self,id):
- '''Return a Bug object given bug id, populated with simple info'''
- r = self._proxy.bugzilla.getBugSimple(id, self.user, self.password)
- return Bug(bugzilla=self,dict=r)
-
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'].
@@ -166,6 +153,15 @@ class Bugzilla(object):
'''
return self._proxy.bugzilla.runQuery(query,self.user,self.password)
+ # these return Bug objects
+ def getbugfull(self,id):
+ '''Return a Bug object with the full complement of bug data
+ already loaded.'''
+ return Bug(bugzilla=self,dict=self._getbugfull(id))
+ def getbug(self,id):
+ '''Return a Bug object given bug id, populated with simple info'''
+ r = self._getbug(id)
+ return Bug(bugzilla=self,dict=self._getbug(id))
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'].
@@ -400,7 +396,7 @@ class Bug(object):
if not 'bug_id' in self.__dict__:
raise AttributeError
#print "Bug %i missing %s - loading" % (self.bug_id,name)
- r = self.bugzilla._getbug(self.bug_id)
+ r = self.bugzilla._getbugfull(self.bug_id)
self.__dict__.update(r)
if name in self.__dict__:
return self.__dict__[name]