Example #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"))

    collections = pkgdblib.count_collection(SESSION)
    collections_fedora = pkgdblib.count_fedora_collection(SESSION)

    cnt = 1
    collections_fedora_lbl = []
    collections_fedora_data = []
    for item in collections_fedora:
        collections_fedora_lbl.append([cnt, str(item[0])])
        collections_fedora_data.append([cnt, float(item[1])])
        cnt += 1

    # 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,
        collections_fedora_lbl=collections_fedora_lbl,
        collections_fedora_data=collections_fedora_data,
        top_maintainers=top_maintainers,
        top_poc=top_poc,
    )
Example #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)
    collections_fedora = pkgdblib.count_fedora_collection(SESSION)

    cnt = 1
    collections_fedora_lbl = []
    collections_fedora_data = []
    for item in collections_fedora:
        collections_fedora_lbl.append([cnt, str(item[0])])
        collections_fedora_data.append([cnt, float(item[1])])
        cnt += 1

    # 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,
        collections_fedora_lbl=collections_fedora_lbl,
        collections_fedora_data=collections_fedora_data,
        top_maintainers=top_maintainers,
        top_poc=top_poc,
    )