commit 760f94d19e8dc52d1fa738d0a467c9b19cf3d4fe Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Thu Mar 6 11:48:16 2014 +0100
Add get_packagers method to retrieve packagers via the API
pkgdb.py | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) --- diff --git a/pkgdb.py b/pkgdb.py index 0631885..548a230 100644 --- a/pkgdb.py +++ b/pkgdb.py @@ -333,6 +333,29 @@ class PkgDB(object):
return output
+ def get_packagers(self, pattern='*'): + ''' Return the list of packagers matching the provided criterias. + + :kwarg pattern: + + ''' + args = { + 'pattern': pattern, + } + + req = self.session.get( + '{0}/api/packagers/'.format(self.url), params=args + ) + LOG.debug('Called: %s with arg %s', req.url, args) + + output = req.json() + + if req.status_code != 200: + LOG.debug('full output %s', output) + raise PkgDBException(output['error']) + + return output + def orphan_packages(self, packages, branches): ''' Orphans the provided list of packages on the provided list of branches.
packagedb-cli-commits@lists.stg.fedorahosted.org