commit fe30dbae3c50db547f29786c25382139e879cf6c Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Thu Mar 6 11:56:37 2014 +0100
Add get_packager_stats method to retrieve stats about a packager via the API
pkgdb.py | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) --- diff --git a/pkgdb.py b/pkgdb.py index 89e74d9..eb37c74 100644 --- a/pkgdb.py +++ b/pkgdb.py @@ -323,6 +323,30 @@ class PkgDB(object):
return output
+ def get_packager_stats(self, username): + ''' Return for the specified user, the number of packages on each + active branch for which he/she is the point of contact. + + :arg username: + + ''' + args = { + 'packagername': username, + } + + req = self.session.get( + '{0}/api/packager/stats/'.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 get_packagers(self, pattern='*'): ''' Return the list of packagers matching the provided criterias.
packagedb-cli-commits@lists.stg.fedorahosted.org