incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r1185028 - /incubator/public/trunk/clutch.py
Date Mon, 17 Oct 2011 07:20:46 GMT
Author: crossley
Date: Mon Oct 17 07:20:45 2011
New Revision: 1185028

URL: http://svn.apache.org/viewvc?rev=1185028&view=rev
Log:
Updated clutch.py to use python3. Used '2to3-3.2' then some hand-edits.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1185028&r1=1185027&r2=1185028&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Mon Oct 17 07:20:45 2011
@@ -60,14 +60,14 @@ Note: The 'svn log' queries might only r
 # FIXME: Better deal with input/output/unicode.
 # FIXME: See some other suggestions in issue INCUBATOR-78.
 
-import commands
+import subprocess
 import datetime
-import HTMLParser
+from html.parser import HTMLParser
 import os.path
 import pickle
 import pprint
 import re
-import urllib2
+import urllib.request, urllib.error, urllib.parse
 import xml.dom.minidom
 import argparse
 
@@ -126,14 +126,11 @@ inputFile = open('clutch.pkl', 'rb')
 state = pickle.load(inputFile)
 inputFile.close()
 
-def ignorecasecmp(left, right):
-  return cmp(left.upper(), right.upper())
-
-print "Gather data from the ReportingSchedule ..."
+print("Gather data from the ReportingSchedule ...") 
 # Parse the wiki ReportingSchedule to gather project details
-req = urllib2.Request(
+req = urllib.request.Request(
     url='http://wiki.apache.org/incubator/ReportingSchedule?action=raw')
-text = urllib2.urlopen(req).read()
+text = urllib.request.urlopen(req).read().decode('utf-8')
 tokens = re.findall('\*.+', text)
 for token in tokens:
   token = token.strip() # strip whitespace
@@ -218,12 +215,11 @@ for token in tokens:
 # End of processing the ReportingSchedule wiki page
 
 # Process the reporting schedule data, detect some potential issues.
-projectNames = projects.keys()
-projectNames.sort(ignorecasecmp)
-for k in projectNames:
-  #print "Name: %s" % k
+projectNames = list(projects.keys())
+for k in sorted(projectNames, key=str.lower):
+  #print("Name: %s" % k)
   if projects[k]['reportingGroup'] == 'month':
-    print 'ERROR: %s: missing group' % k
+    print('ERROR: %s: missing group' % k)
     projects[k]['hasReportingGroup'] = False
   # Some projects use an alternate short resource name
   # rather than their project name
@@ -240,7 +236,7 @@ for k in projectNames:
   elif k == "odftoolkit":
     projects[k]['resourceNames'].append("odf")
   if optionVerbose and len(projects[k]['resourceNames']) > 1:
-    print "DEBUG: Will try alternate names: %s" % projects[k]['resourceNames']
+    print("DEBUG: Will try alternate names: %s" % projects[k]['resourceNames'])
 
 # Parse the projects table, ensure each is present, grab more details
 
@@ -259,7 +255,7 @@ dom = xml.dom.minidom.parse("site-author
 
 graduatedProjects = {}
 
-print "Gather data from podlings.xml ..."
+print("Gather data from podlings.xml ...")
 for row in dom.getElementsByTagName("podling"):
  if row.getAttribute("status") == 'graduated':
   resource = row.getAttribute("resource")
@@ -269,7 +265,7 @@ for row in dom.getElementsByTagName("pod
   fileBaseName = row.getAttribute("resource")
   name = name.strip() # strip whitespace
   id = name.lower()
-  #print "Name: %s" % name
+  #print("Name: %s" % name)
   id = id.replace(' ', '') # strip spaces from project ID
   # handle some inconsistent names
   # FIXME: perhaps need to use resourceNames
@@ -305,11 +301,11 @@ for row in dom.getElementsByTagName("pod
         else:
           mentorsProjects[theMentor] += ", %s" % projectsTable[id]['name']
   else:
-    print 'ERROR: %s: row exists' % id
+    print('ERROR: %s: row exists' % id)
 
 dom.unlink()
 
-print "Gather data from the graduating list ..."
+print("Gather data from the graduating list ...")
 graduates = []
 inputFile = open('clutch-graduating.txt', 'r')
 for line in inputFile:
@@ -319,15 +315,14 @@ for line in inputFile:
 inputFile.close()
 
 # Process the incubation table data, detect some potential issues.
-print "Gather details from project status files ..."
-projectNames = projectsTable.keys()
-projectNames.sort(ignorecasecmp)
-for k in projectNames:
-  #print "Name: %s" % k
+print("Gather details from project status files ...")
+projectNames = list(projectsTable.keys())
+for k in sorted(projectNames, key=str.lower):
+  #print("Name: %s" % k)
   try:
     projects[k]
   except KeyError:
-    print 'ERROR: %s: Missing from reporting schedule' % k
+    print('ERROR: %s: Missing from reporting schedule' % k)
     errorMsg = """%(a)s: Not listed in %(b)s, yet listed in %(c)s""" % \
         {'a': k, 'b': linkReportingSchedule, 'c': linkIncubationTable}
     errorMsg += ". See <a href=\"#h-Graduate\">help</a>."
@@ -336,8 +331,8 @@ for k in projectNames:
 
   # compare names, ignoring whitespace
   if ''.join(projects[k]['name'].split()).lower() != ''.join(projectsTable[k]['name'].split()).lower():
-    print "WARN: Name '%s' differs from reporting schedule name '%s'" % \
-        (projectsTable[k]['name'], projects[k]['name'])
+    print("WARN: Name '%s' differs from reporting schedule name '%s'" % \
+        (projectsTable[k]['name'], projects[k]['name']))
 
   # parse their project status file to extract specific information
   statusFile = "site-author/projects/%s.xml" % projectsTable[k]['statusFileName']
@@ -345,19 +340,19 @@ for k in projectNames:
     dom = xml.dom.minidom.parse(statusFile)
     # get the project info hints
     if optionVerbose:
-      print "DEBUG: Gather hints from project Status page";
+      print("DEBUG: Gather hints from project Status page");
     table = dom.getElementsByTagName("table")[0]
     for row in table.getElementsByTagName("tr")[1:]:
       if (len(row.getElementsByTagName("td")) < 3):
         continue
       cell = row.getElementsByTagName("td")[2]
-      if cell.attributes.has_key('id'):
+      if 'id' in cell.attributes:
         values = [getText(item.childNodes) for item in cell.childNodes]
         value = " ".join(values).strip()
         if value == "":
           value = getText(cell.childNodes).strip()
         if optionVerbose:
-          print "DEBUG: Hint: %(a)s=%(b)s" % {'a': cell.getAttribute('id'), 'b': value}
+          print("DEBUG: Hint: %(a)s=%(b)s" % {'a': cell.getAttribute('id'), 'b': value})
         if cell.getAttribute('id') == "mail-dev":
           value = value.replace('  at  ', '@')
           value = value.replace('  Subscribe  Unsubscribe', '')
@@ -386,7 +381,7 @@ for k in projectNames:
         matchUrl = re.search(urlHttpRE, value)
         if not matchUrl:
           for item in cell.getElementsByTagName('a'):
-            if item.attributes.has_key('href'):
+            if 'href' in item.attributes:
               value = item.getAttribute('href')
               break
         matchUrl = re.search(urlHttpRE, value)
@@ -405,7 +400,7 @@ for k in projectNames:
           continue
     # Scan the project News section and count new commiters.
     for section in dom.getElementsByTagName("section"):
-      if section.attributes.has_key('id') and section.getAttribute('id') == "News":
+      if 'id' in section.attributes and section.getAttribute('id') == "News":
         for line in section.toxml().splitlines():
           if ('<!--' in line):
             continue
@@ -420,13 +415,14 @@ for k in projectNames:
 
 # end of processing incubation table data
 
-print "Gather committers data ..."
+print("Gather committers data ...")
 # Jim's "projects" page is the easiest way. However it has a very flat
 # structure and the xml is not valid. Need to process the "table" which follows
 # each "h2" element.
-class CommittersParser(HTMLParser.HTMLParser):
+class CommittersParser(HTMLParser):
 
   def __init__(self):
+    self.strict = True
     self.projects = {}
     self.projectId = "default"
     self.projects['default'] = []
@@ -440,6 +436,8 @@ class CommittersParser(HTMLParser.HTMLPa
       for key, value in attrs:
         if key == "id":
           self.projectId = value
+          if optionVerbose:
+            print("project=%s" % value)
           try:
             self.projects[value]
           except KeyError:
@@ -462,15 +460,19 @@ class CommittersParser(HTMLParser.HTMLPa
           self.projects[self.projectId].append(name)
 
 committersUrl = "http://people.apache.org/committers-by-project.html"
-committersInput = urllib2.urlopen(committersUrl)
+committersInput = urllib.request.urlopen(committersUrl)
+dataCommitters = committersInput.read().decode('utf-8')
+#print("dataCommitters=%s" % dataCommitters)
 committers = CommittersParser()
-committers.feed(committersInput.read())
+committers.feed(dataCommitters)
 committers.close()
+#pprint.pprint(committers.projects)
 
-print "Gather incubator group mail list data ..."
-class IncubatorMailListNamesParser(HTMLParser.HTMLParser):
+print("Gather incubator group mail list data ...")
+class IncubatorMailListNamesParser(HTMLParser):
 
   def __init__(self):
+    self.strict = True
     self.names = []
     self.reset()
 
@@ -483,20 +485,18 @@ class IncubatorMailListNamesParser(HTMLP
 
 mailListsUrl = "http://incubator.apache.org/mail/"
 mailLists = IncubatorMailListNamesParser()
-mailLists.feed(urllib2.urlopen(mailListsUrl).read())
+mailLists.feed(urllib.request.urlopen(mailListsUrl).read().decode('utf-8'))
 mailLists.close()
+#pprint.pprint(mailLists.names)
 del mailLists.names[0:5] # the first 5 are page navigation
-# remove some special lists
-mailLists.names.remove("announce/")
-mailLists.names.remove("cvs/")
-mailLists.names.remove("general/")
-mailLists.names.remove("projects/")
 projectMailLists = {}
 mailListNamesRE = re.compile("(.*)-([^-]+)/")
 mailListNamesUsualRE = re.compile("commits|cvs|dev|issues|user|spec")
 for listName in mailLists.names:
+  if listName in ["announce/","cvs/","general/","projects/"]:
+    continue
   if optionVerbose:
-    print "DEBUG: listName=%s" % listName
+    print("DEBUG: listName=%s" % listName)
   if listName.find("/") == -1:
     continue
   if ('-' in listName):
@@ -508,12 +508,12 @@ for listName in mailLists.names:
     listName = listName.replace('/', '')
     projectMailLists[matchList.group(1)][matchList.group(2)] = listName
     if optionVerbose:
-      print "DEBUG: Found list: %(a)s %(b)s" % {'a': matchList.group(1), 'b': matchList.group(2)}
+      print("DEBUG: Found list: %(a)s %(b)s" % {'a': matchList.group(1), 'b': matchList.group(2)})
     # FIXME: We assume that mail lists are always named like this
     # with "-dev" or "-commits" etc.
     matchListUsual = re.search(mailListNamesUsualRE, matchList.group(2))
     if optionVerbose and not matchListUsual:
-      print "WARN: Unusual mail list name '%s'" % listName
+      print("WARN: Unusual mail list name '%s'" % listName)
   else:
     listName = listName.replace('/', '')
     try:
@@ -521,20 +521,20 @@ for listName in mailLists.names:
     except KeyError:
       projectMailLists[listName] = {}
     projectMailLists[listName]["dev"] = listName
-    print "WARN: %(a)s: unusual mail list name '%(b)s', assuming it is their dev list" %
\
-        {'a': listName, 'b': projectMailLists[listName]["dev"]}
+    print("WARN: %(a)s: unusual mail list name '%(b)s', assuming it is their dev list" %
\
+        {'a': listName, 'b': projectMailLists[listName]["dev"]})
 if optionVerbose:
-  print "DEBUG: projectMailLists"
+  print("DEBUG: projectMailLists")
   pprint.pprint(projectMailLists)
 
-print "Gather incubator PGP keys data ..."
+print("Gather incubator PGP keys data ...")
 keysNamesRE = re.compile("/dist/incubator/([^/]+)/(.*)")
 keysList = {}
-req = urllib2.Request(
+req = urllib.request.Request(
     url='http://people.apache.org/~crossley/incubator-keys.txt')
-lines = urllib2.urlopen(req).readlines()
+lines = urllib.request.urlopen(req).readlines()
 for line in lines:
-  matchKey = re.search(keysNamesRE, line)
+  matchKey = re.search(keysNamesRE, line.decode('utf-8'))
   if matchKey:
     keysList[matchKey.group(1)] = "%(a)s/%(b)s/%(c)s" % \
       {'a': "http://www.apache.org/dist/incubator",
@@ -542,13 +542,13 @@ for line in lines:
        'c': matchKey.group(2)
       }
 
-print "Gather data about releases ..."
+print("Gather data about releases ...")
 releases = {}
-req = urllib2.Request(
+req = urllib.request.Request(
     url='http://people.apache.org/~crossley/incubator-releases.txt')
-lines = urllib2.urlopen(req).readlines()
+lines = urllib.request.urlopen(req).readlines()
 for line in lines:
-  match = re.search(releasesRE, line)
+  match = re.search(releasesRE, line.decode('utf-8'))
   if match:
     try:
       releases[match.group(1)]
@@ -562,26 +562,25 @@ for k in releases:
       graduatedProjects[k]
     except KeyError:
       if optionInfo:
-        print 'INFO: %s: dormant/retired project has remains on Incubator mirrors' % k
+        print('INFO: %s: dormant/retired project has remains on Incubator mirrors' % k)
     else:
-      print 'ERROR: %s: graduated project has remains on Incubator mirrors' % k
+      print('ERROR: %s: graduated project has remains on Incubator mirrors' % k)
       errorMsg = """%(a)s: Has graduated, but still has remains on Incubator distribution
mirrors""" % \
           {'a': k}
       errorMsg += ". See <a href=\"#h-Graduate\">help</a>."
       otherIssues.append(errorMsg)
       continue
 
-print "Processing ..."
+print("Processing ...")
 # Process the reporting schedule data, correlate and ensure each exists in the
 # incubation projects summary table, add more details to the data store.
-projectNames = projects.keys()
-projectNames.sort(ignorecasecmp)
-for k in projectNames:
-  print k
+projectNames = list(projects.keys())
+for k in sorted(projectNames, key=str.lower):
+  print(k)
   try:
     projectsTable[k]
   except KeyError:
-    print 'ERROR: %s: Missing from incubation table' % k
+    print('ERROR: %s: Missing from incubation table' % k)
     projects[k]['hasStatusEntry'] = False
     continue
 
@@ -592,7 +591,7 @@ for k in projectNames:
 
   statusFile = "site-author/projects/%s.xml" % projectsTable[k]['statusFileName']
   if not os.path.exists(statusFile):
-    print 'ERROR: %s: Missing status file' % k
+    print('ERROR: %s: Missing status file' % k)
     projects[k]['hasStatusEntry'] = False
     continue
 
@@ -611,7 +610,7 @@ for k in projectNames:
       entryDate = datetime.datetime(
           int(match.group(1)), int(match.group(2)), entryDateDay)
     except ValueError:
-      print 'ERROR: %s: ValueError with date' % k
+      print('ERROR: %s: ValueError with date' % k)
     else:
       projects[k]['entryDate'] = entryDate
 
@@ -619,11 +618,11 @@ for k in projectNames:
   # FIXME: Perhaps this operation could be improved. Use "subprocess" module.
   # On this older Mac still python-2.3.5, so no. See notes at top.
   if optionVerbose:
-    print "DEBUG: Parsing svn log for site-author/projects/%s.xml ..." % \
-        projects[k]['statusFileName']
+    print("DEBUG: Parsing svn log for site-author/projects/%s.xml ..." % \
+        projects[k]['statusFileName'])
   command = "svn log --xml site-author/projects/%s.xml" % \
       projects[k]['statusFileName']
-  dom = xml.dom.minidom.parseString(commands.getoutput(command))
+  dom = xml.dom.minidom.parseString(subprocess.getoutput(command))
   rowCounter = 0
   count1 = 0
   count2 = 0
@@ -659,9 +658,9 @@ for k in projectNames:
 
 # end of processing
 
-print "Detect certain resources ..."
-for k in projectNames:
-  print k
+print("Detect certain resources ...")
+for k in sorted(projectNames, key=str.lower):
+  print(k)
 
   # Add the number of committers
   # Sometimes the committer SVN group name contains the sponsor TLP,
@@ -683,7 +682,7 @@ for k in projectNames:
     svnGroups.append(tlpSvn)
   for svnGroup in svnGroups:
     if optionVerbose:
-      print "DEBUG: Trying committers group '%s'" % svnGroup
+      print("DEBUG: Trying committers group '%s'" % svnGroup)
     try:
       committers.projects[svnGroup]
     except KeyError:
@@ -693,7 +692,7 @@ for k in projectNames:
       projects[k]['committersSvn'] = svnGroup
       break
   if projects[k]['committersSvn'] == None and optionInfo:
-    print "INFO: %s: Does not yet have committers accounts" % k
+    print("INFO: %s: Does not yet have committers accounts" % k)
 
   # Detect if they have SVN yet.
   # First, try the URL from their status page
@@ -713,16 +712,16 @@ for k in projectNames:
       urls.append("http://svn.apache.org/repos/asf/incubator/%s/" % name)
     for url in urls:
       if optionVerbose:
-        print 'DEBUG: Trying SVN URL %s' % url
+        print('DEBUG: Trying SVN URL %s' % url)
       try:
-        urllib2.urlopen(url)
+        urllib.request.urlopen(url)
       except IOError:
         projects[k]['urlSvn'] = ''
       else:
         projects[k]['urlSvn'] = url
         break
     if not projects[k]['urlSvn'] and optionInfo:
-      print 'INFO: %s: Does not yet have SVN' % k
+      print('INFO: %s: Does not yet have SVN' % k)
 
   # Detect if they have Tracker yet.
   # First, try the url from their status page
@@ -737,16 +736,16 @@ for k in projectNames:
       if url == "":
         continue
       if optionVerbose:
-        print "DEBUG: Trying Tracker URL: %s" % url
+        print("DEBUG: Trying Tracker URL: %s" % url)
       try:
-        urllib2.urlopen(url)
+        urllib.request.urlopen(url)
       except IOError:
         projects[k]['urlTracker'] = ""
       else:
         projects[k]['urlTracker'] = url
         break
     if not projects[k]['urlTracker'] and optionInfo:
-      print 'INFO: %s: Does not yet have an Issue Tracker' % k
+      print('INFO: %s: Does not yet have an Issue Tracker' % k)
 
   # Detect if they have a website yet.
   # First, try the url from their status page
@@ -761,14 +760,14 @@ for k in projectNames:
       if url == "":
         continue
       try:
-        urllib2.urlopen(url)
+        urllib.request.urlopen(url)
       except IOError:
         projects[k]['urlWww'] = ""
       else:
         projects[k]['urlWww'] = url
         break
     if not projects[k]['urlWww'] and optionInfo:
-      print 'INFO: %s: Does not yet have a website' % k
+      print('INFO: %s: Does not yet have a website' % k)
 
   # See if they have a distribution area yet.
   if optionUseClutchState and projects[k]['hasClutchState'] and state[k]['urlDist']:
@@ -778,9 +777,9 @@ for k in projectNames:
       urlDist = "http://www.apache.org/dist/incubator/%s/" % nameDist
       urlMirror = "http://www.apache.org/dyn/closer.cgi/incubator/%s/" % nameDist
       if optionVerbose:
-        print 'DEBUG: Trying dist area %s' % urlDist
+        print('DEBUG: Trying dist area %s' % urlDist)
       try:
-        urllib2.urlopen(urlDist)
+        urllib.request.urlopen(urlDist)
       except IOError:
         pass
       else:
@@ -788,9 +787,9 @@ for k in projectNames:
         break
   if not projects[k]['urlDist']:
     if optionInfo:
-      print 'INFO: %s: Does not yet have a distribution area' % k
+      print('INFO: %s: Does not yet have a distribution area' % k)
   elif optionVerbose:
-    print 'DEBUG: dist=%s' % projects[k]['urlDist']
+    print('DEBUG: dist=%s' % projects[k]['urlDist'])
 
   # Detect if they have a PGP KEYS file
   if projects[k]['urlDist']:
@@ -801,11 +800,11 @@ for k in projectNames:
         keysList[nameDistArea]
       except KeyError:
         if optionInfo:
-          print 'INFO: %s: Does not yet have a PGP KEYS file' % k
+          print('INFO: %s: Does not yet have a PGP KEYS file' % k)
       else:
         projects[k]['urlKeys'] = keysList[nameDistArea]
   if optionVerbose:
-    print 'DEBUG: KEYS=%s' % projects[k]['urlKeys']
+    print('DEBUG: KEYS=%s' % projects[k]['urlKeys'])
 
   # Detect mail lists established:
   # For each alternate resourceName:
@@ -824,7 +823,7 @@ for k in projectNames:
         mailListHintKey = "hintMailListCommits"
         mailListKey = "hasMailListCommits"
       if optionVerbose:
-        print "DEBUG: Looking for mailList: %s" % projects[k][mailListHintKey]
+        print("DEBUG: Looking for mailList: %s" % projects[k][mailListHintKey])
       matchMail = re.search(mailListNameRE, projects[k][mailListHintKey])
       if matchMail:
         mailListGroup = "%s" % matchMail.group(1)
@@ -833,8 +832,8 @@ for k in projectNames:
         mailListGroup = "incubator"
         mailListNameHint = ""
       if optionVerbose:
-        print "DEBUG: Trying mailListGroup=%(a)s mailListNameHint=%(b)s" % \
-            {'a': mailListGroup, 'b': mailListNameHint}
+        print("DEBUG: Trying mailListGroup=%(a)s mailListNameHint=%(b)s" % \
+            {'a': mailListGroup, 'b': mailListNameHint})
       if mailListGroup == "incubator":
         mailListNameDefault = "%(a)s-%(b)s" % {'a': projectName, 'b': listType}
         if mailListNameDefault == mailListNameHint:
@@ -843,25 +842,25 @@ for k in projectNames:
           if listName == "":
             continue
           if optionVerbose:
-            print "DEBUG: Trying listName=%s" % listName
+            print("DEBUG: Trying listName=%s" % listName)
           try:
             projectMailLists[projectName]
           except KeyError:
             if optionVerbose:
-              print "DEBUG: %s: No incubator group mail lists using '%s' " % (k, projectName)
+              print("DEBUG: %s: No incubator group mail lists using '%s' " % (k, projectName))
             break
           try:
             projectMailLists[projectName][listType]
           except:
             if optionInfo:
-              print "INFO: %(a)s: Does not yet have hinted incubator mail list '%(b)s-%(c)s'"
% \
-                  {'a': k, 'b': projectName, 'c': listType}
+              print("INFO: %(a)s: Does not yet have hinted incubator mail list '%(b)s-%(c)s'"
% \
+                  {'a': k, 'b': projectName, 'c': listType})
             projects[k][mailListKey] = ""
           else:
             projects[k][mailListKey] = "http://mail-archives.apache.org/mod_mbox/incubator-%(a)s/"
% \
                 {'a': projectMailLists[projectName][listType]}
             if optionVerbose:
-              print "DEBUG: Successful Incubator mail url: %s" % projects[k][mailListKey]
+              print("DEBUG: Successful Incubator mail url: %s" % projects[k][mailListKey])
             foundMailLists = True
             break
       # End of processing incubator group mail list.
@@ -869,27 +868,27 @@ for k in projectNames:
         listName = projects[k][mailListHintKey]
         url = "http://mail-archives.apache.org/mod_mbox/%s/" % listName
         if optionVerbose:
-          print "DEBUG: Trying mail url: %s" % url
+          print("DEBUG: Trying mail url: %s" % url)
         try:
-          urllib2.urlopen(url)
+          urllib.request.urlopen(url)
         except IOError:
           projects[k][mailListKey] = ""
         else:
           projects[k][mailListKey] = url
           if optionVerbose:
-            print "DEBUG: Successful TLP mail url: %s" % url
+            print("DEBUG: Successful TLP mail url: %s" % url)
           foundMailLists = True
     if foundMailLists:
       break
   # End of processing project mail lists.
   if not projects[k]['hasMailListDev'] and optionInfo:
-    print "INFO: %s: Does not yet have 'dev' mail list" % k
+    print("INFO: %s: Does not yet have 'dev' mail list" % k)
   if not projects[k]['hasMailListCommits'] and optionInfo:
-    print "INFO: %s: Does not yet have 'commits' mail list" % k
+    print("INFO: %s: Does not yet have 'commits' mail list" % k)
 
 # end of processing
 
-print "Output the data ..."
+print("Output the data ...")
 reportingGroups = {'month': 'Monthly',
     'group-1': 'January,April,July,October',
     'group-2': 'February,May,August,November',
@@ -1084,7 +1083,7 @@ reportList2 = ""
 reportList3 = ""
 tableRowCount = 0
 tableRowCountMid = int(len(projects) / 2)
-for k in projectNames:
+for k in sorted(projectNames, key=str.lower):
   tableRowCount += 1
   if tableRowCount == tableRowCountMid:
     fileXml.write(tableColumnHeadersXml)
@@ -1131,7 +1130,7 @@ for k in projectNames:
   else:
     reportDevList += ' <general@incubator.apache.org>'
   if optionVerbose:
-    print "DEBUG: reportDevList=%s" % reportDevList
+    print("DEBUG: reportDevList=%s" % reportDevList)
   if projects[k]['reportingMonthly']:
     reportList1 += '%s\n' % reportDevList
     reportList2 += '%s\n' % reportDevList
@@ -1494,7 +1493,7 @@ fileXml.write("""    <section id="mentor
       </p>
       <ul>
 """)
-mentors = mentorsProjects.keys()
+mentors = list(mentorsProjects.keys())
 mentors.sort()
 for mentor in mentors:
   fileXml.write("        <li><strong>%(a)s</strong>: %(b)s</li>\n"
% {'a': mentor, 'b':mentorsProjects[mentor]})
@@ -1582,5 +1581,5 @@ outputFile = open('clutch.pkl', 'wb')
 pickle.dump(output, outputFile, pickle.HIGHEST_PROTOCOL)
 outputFile.close()
 
-print "Done. Generated site-author/clutch.xml file."
-print "Now you need to re-build the site, as usual."
+print("Done. Generated site-author/clutch.xml file.")
+print("Now you need to re-build the site, as usual.")



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message