Ejemplo n.º 1
0
def tag_coverage_view(coverage_rule):
    return_value = OrderedDict()
    graph_manager = GraphManager()
    rule_data, pkg_len, locale_len, tag_len, release_name = \
        graph_manager.get_trans_stats_by_rule(coverage_rule)
    return_value.update(
        dict(coverage_rule=coverage_rule,
             rule_data=rule_data,
             package_len=pkg_len,
             locale_len=locale_len,
             build_tag_len=tag_len,
             release=release_name))
    return return_value
Ejemplo n.º 2
0
def graph_data(request):
    """
    Prepares and dispatch graph data
    """
    graph_dataset = {}
    if request.is_ajax():
        graph_manager = GraphManager()
        if 'package' in request.POST.dict() and 'locale' in request.POST.dict():
            package = request.POST.dict().get('package')
            locale = request.POST.dict().get('locale')
            graph_dataset = graph_manager.get_stats_by_pkg_per_lang(package, locale)
        elif 'package' in request.POST.dict():
            package = request.POST.dict().get('package')
            graph_dataset = graph_manager.get_trans_stats_by_package(package)
        elif 'graph_rule' in request.POST.dict():
            graph_rule = request.POST.dict().get('graph_rule')
            graph_dataset = graph_manager.get_trans_stats_by_rule(graph_rule)
    return JsonResponse(graph_dataset)