esc-reporting/esc-analyze.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
New commits: commit ebcf0a907b22ffcb26be6a6756e7882e63293cdb Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Oct 11 14:42:24 2019 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Oct 11 14:42:24 2019 +0200 ESC: read gzip files correctly diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py index bdfcf74..5bf0848 100755 --- a/esc-reporting/esc-analyze.py +++ b/esc-reporting/esc-analyze.py @@ -959,13 +959,17 @@ def runAnalyze(): global cfg, statList global openhubData, bugzillaData, bugzillaESCData, gerritData, gitData, crashData, weekList, automateData, committersNames + weekList = None x = (cfg['nowDate'] - datetime.timedelta(days=7)).strftime('%Y-%m-%d') - jsonFileName = 'stats_' + x + '.json' - gzFilePath = cfg['homedir'] + 'archive/' + jsonFileName + '.gz' + gzFilePath = cfg['homedir'] + 'archive/stats_' + x + '.json.gz' if os.path.isfile(gzFilePath): - with gzip.open(gzFilePath , 'rb'): - weekList = util_load_file(jsonFileName) - else: + fp = gzip.open(gzFilePath) + content = fp.read() + fp.close() + if content: + weekList = json.loads(content.decode('utf-8')) + + if not weekList: weekList = util_create_statList() openhubData = util_load_data_file(cfg['homedir'] + 'dump/openhub_dump.json') _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits