[Libreoffice-commits] dev-tools.git: esc-reporting/esc-analyze.py

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 10 11:10:47 UTC 2019


 esc-reporting/esc-analyze.py |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 9f60bf87a757e6a50aa92f21e3ea3a8f05c9592c
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Oct 10 12:11:08 2019 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Oct 10 13:01:43 2019 +0200

    ESC: Check if .gz file exists
    
    otherwise, use an empty statList

diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py
index 0ec0b39..bdfcf74 100755
--- a/esc-reporting/esc-analyze.py
+++ b/esc-reporting/esc-analyze.py
@@ -224,15 +224,17 @@ def util_create_statList():
                          'haveBacktrace': 0, 'needsDevAdvice': 0, 'android': 0, 'ios': 0, 'online': 0}},
                      'easyhacks' : {'needsDevEval': 0,  'needsUXEval': 0, 'cleanup_comments': 0,
                                     'total': 0,         'assigned': 0,    'open': 0},
-                     'esc': {}},
+                     'esc': {
+                       'regression': {'open': 0, 'total': 0}
+                       }},
                      'stat': {'openhub_last_analyse': "2001-01-01"},
                      'people': {},
-                     'escList': {},
+                     'escList': {
+                       'bisect': [],
+                       'bibisect': []
+                       },
                      'reportList': {}}
 
-
-
-
 def util_check_mail(name, xmail):
     global statList
 
@@ -958,8 +960,13 @@ def runAnalyze():
     global openhubData, bugzillaData, bugzillaESCData, gerritData, gitData, crashData, weekList, automateData, committersNames
 
     x = (cfg['nowDate'] - datetime.timedelta(days=7)).strftime('%Y-%m-%d')
-    with gzip.open(cfg['homedir'] + 'archive/stats_' + x + '.json.gz', 'rb'):
-      weekList = util_load_file('stats_' + x + '.json')
+    jsonFileName = 'stats_' + x + '.json'
+    gzFilePath = cfg['homedir'] + 'archive/' + jsonFileName + '.gz'
+    if os.path.isfile(gzFilePath):
+      with gzip.open(gzFilePath , 'rb'):
+        weekList = util_load_file(jsonFileName)
+    else:
+      weekList = util_create_statList()
 
     openhubData = util_load_data_file(cfg['homedir'] + 'dump/openhub_dump.json')
     bugzillaData = util_load_data_file(cfg['homedir'] + 'dump/bugzilla_dump.json')


More information about the Libreoffice-commits mailing list