You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/09/02 23:15:39 UTC

svn commit: r1912060 - /comdev/reporter.apache.org/trunk/scripts/pdata.py

Author: sebb
Date: Sat Sep  2 23:15:39 2023
New Revision: 1912060

URL: http://svn.apache.org/viewvc?rev=1912060&view=rev
Log:
Simplify: don't init vars far from first use

And make sure they are init with the correct type

Modified:
    comdev/reporter.apache.org/trunk/scripts/pdata.py

Modified: comdev/reporter.apache.org/trunk/scripts/pdata.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/pdata.py?rev=1912060&r1=1912059&r2=1912060&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/pdata.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/pdata.py Sat Sep  2 23:15:39 2023
@@ -285,18 +285,6 @@ def generate(user, project, runkibble):
                 nentry = entry.replace("empire-", "empire-db-")
             if tlp  == mlid:
                 emails[nentry] = mld[entry]
-                
-        dates = {}
-        bdata = {} # bugzilla data
-        jdata = {}
-        cdata = {}
-        ddata = {}
-        rdata = {}
-        keys = {}
-        count = {}
-        health = {}
-        
-        checker = {}
         
         group = project
     
@@ -316,6 +304,7 @@ def generate(user, project, runkibble):
             bdata = bugzillastats[group]
         else:
             bdata = [0,0,{}]
+        keys = []
         # a PMC may have projects using Bugzilla *and* JIRA - e.g. Tomcat - (or neither)
         jiraname = group.upper()
         if group in jmap:
@@ -345,7 +334,7 @@ def generate(user, project, runkibble):
             jdata[1] += y
             jdata[2] = p
 
-        cdata = cdata[xgroup] if xgroup in cdata else {'pmc': {}, 'committer': {}}
+        cdata = {'pmc': {}, 'committer': {}}
         for pmc in pchanges:
             if pmc == xgroup:
                 for member in pchanges[pmc]:
@@ -358,12 +347,16 @@ def generate(user, project, runkibble):
                         cdata['committer'][member] = cchanges[pmc][member]
         if group in pmcdates: # Make sure we have this PMC in the JSON, so as to not bork
             dates = pmcdates[group] # only send the groups we want
+        else:
+            dates = {}
         if checker_json and 'meta' in checker_json and 'projects' in checker_json:
             meta = checker_json['meta']
             prjs = checker_json['projects']
             checker = prjs[group] if group in prjs else { 'errors': 0 }
             checker['meta'] = meta
-        
+        else:
+            checker = {}
+
         # Add in kibble data if called with only= OR only one project...
         kibble = None
         if runkibble: