def stats(): ''' Display some statistics aboue the packages in the DB. ''' collections = pkgdblib.search_collection(SESSION, '*', 'Active') collections.extend(pkgdblib.search_collection( SESSION, '*', 'Under Development')) packages = {} for collection in collections: packages_count = pkgdblib.search_package( SESSION, pkg_name='*', clt_name=collection.branchname, count=True ) packages[collection.branchname] = packages_count # Top maintainers top_maintainers = pkgdblib.get_top_maintainers(SESSION) # Top point of contact top_poc = pkgdblib.get_top_poc(SESSION) return flask.render_template( 'stats.html', packages=packages, top_maintainers=top_maintainers, top_poc=top_poc, )
def stats(): ''' Display some statistics aboue the packages in the DB. ''' collections = pkgdblib.search_collection(SESSION, '*', 'Active') collections.extend(pkgdblib.search_collection( SESSION, '*', 'Under Development')) collections = pkgdblib.count_collection(SESSION) # Top maintainers top_maintainers = pkgdblib.get_top_maintainers(SESSION) # Top point of contact top_poc = pkgdblib.get_top_poc(SESSION) return flask.render_template( 'stats.html', collections=collections, top_maintainers=top_maintainers, top_poc=top_poc, )
def stats(): ''' Display some statistics aboue the packages in the DB. ''' collections = pkgdblib.search_collection(SESSION, '*', 'Active') collections.extend( pkgdblib.search_collection(SESSION, '*', 'Under Development')) packages = {} for collection in collections: packages_count = pkgdblib.search_package( SESSION, pkg_name='*', clt_name=collection.branchname, count=True) packages[collection.branchname] = packages_count # Top maintainers top_maintainers = pkgdblib.get_top_maintainers(SESSION) # Top point of contact top_poc = pkgdblib.get_top_poc(SESSION) return flask.render_template( 'stats.html', packages=packages, top_maintainers=top_maintainers, top_poc=top_poc, )
def test_get_top_poc(self): """ Test the get_top_poc function. """ create_package_acl(self.session) top = pkgdblib.get_top_poc(self.session) self.assertEqual(top, [(u'pingou', 2)])