From f465c73c2286bbdba9d41d221222510bf475d002 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Mon, 29 Jun 2015 16:47:57 +0300 Subject: [PATCH] Fix Stat API --- SE_API/GitHub_API_Connector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SE_API/GitHub_API_Connector.py b/SE_API/GitHub_API_Connector.py index b93ef2c..90f4a07 100644 --- a/SE_API/GitHub_API_Connector.py +++ b/SE_API/GitHub_API_Connector.py @@ -27,7 +27,7 @@ def get_repo_weekly_commits(repo_url): return req.json()['all'] def make_macro(stats, info): - macro = {'labels': [], 'data': [0]} + macro = {'labels': [], 'data': [[0]]} macro['labels'].append('Commits') macro['labels'].append('Open Issues') for stat in stats: @@ -37,11 +37,11 @@ def make_macro(stats, info): return macro def make_micro(stats, info): - micro = {'labels': [], 'data': [0], 'series': []} + micro = {'labels': [], 'data': [[]], 'series': []} micro['labels'].append('Commits') micro['labels'].append('Open Issues') for stat in stats: - micro['data'][0] += stat['total'] + micro['data'][0][0] += stat['total'] micro['data'].append(info['open_issues']) return micro