示例#1
0
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,
    )
示例#2
0
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,
    )
示例#3
0
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,
    )
示例#4
0
    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)])
示例#5
0
    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)])