incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1295893 - /incubator/public/trunk/clutch.py
Date Thu, 01 Mar 2012 21:25:20 GMT
Author: sebb
Date: Thu Mar  1 21:25:20 2012
New Revision: 1295893

URL: http://svn.apache.org/viewvc?rev=1295893&view=rev
Log:
Extract site-author location as a constant

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1295893&r1=1295892&r2=1295893&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Thu Mar  1 21:25:20 2012
@@ -20,7 +20,7 @@ Purpose: Clutch gathers details about pr
 
 The core resource is the ReportingSchedule wiki page. As soon as a project is
 accepted into incubation, please add its entry. This script reads that page,
-and the site-author/podlings.xml table, and each podling status page, and
+and the SITE_CONTENT/podlings.xml table, and each podling status page, and
 other resources. The assembled metadata is stored in various data files.
 
 See further explanation at http://incubator.apache.org/clutch.html
@@ -33,7 +33,7 @@ Note: The 'svn log' queries might only r
 
 '''
 External input data files used:
-- site-author/podlings.xml
+- SITE_CONTENT/podlings.xml
 - clutch-graduating.txt
 
 URLs
@@ -48,20 +48,20 @@ http://svn.apache.org/repos/asf/incubato
 
 SVN commands
 'svn', 'ls', '--xml', 'http://svn.apache.org/repos/asf/incubator/'
-'svn', 'log', '--xml', 'site-author/projects/{0}.xml' {status file}
+'svn', 'log', '--xml', 'SITE_CONTENT/projects/{0}.xml' {status file}
 
 Output data files created:
-site-author/clutch.txt
-site-author/clutcho1.ent
-site-author/clutcht.ent
-site-author/clutchr1.ent
-site-author/clutchr2.ent
-site-author/clutcho2.ent
-site-author/clutchm.ent
-site-author/report_due_1.txt
-site-author/report_due_2.txt
-site-author/report_due_3.txt
-site-author/history/entry.txt
+SITE_CONTENT/clutch.txt
+SITE_CONTENT/clutcho1.ent
+SITE_CONTENT/clutcht.ent
+SITE_CONTENT/clutchr1.ent
+SITE_CONTENT/clutchr2.ent
+SITE_CONTENT/clutcho2.ent
+SITE_CONTENT/clutchm.ent
+SITE_CONTENT/report_due_1.txt
+SITE_CONTENT/report_due_2.txt
+SITE_CONTENT/report_due_3.txt
+SITE_CONTENT/history/entry.txt
 
 Pickle file:
 - clutch.pkl (I/O)
@@ -115,6 +115,9 @@ INCUBATOR_KEYS = 'http://people.apache.o
 INCUBATOR_RELEASES = 'http://people.apache.org/~crossley/incubator-releases.txt'
 INCUBATOR_RELEASES_BAD_NAME = 'http://people.apache.org/~crossley/incubator-releases-bad-filename.txt'
 
+# Constant for site content location
+SITE_CONTENT_DIR = 'site-author/'
+
 parser = argparse.ArgumentParser(description='Gather details about projects currently in
incubation.')
 parser.add_argument('--ignoreState',   action='store_true', default='False', help='Ignore
state (default false)')
 parser.add_argument('-v', '--verbose', action='store_true', default='False', help='verbose
mode (default false)')
@@ -302,7 +305,7 @@ def getText(nodelist):
   return rc
 
 # Parse the podlings data file
-dom = xml.dom.minidom.parse("site-author/podlings.xml")
+dom = xml.dom.minidom.parse(SITE_CONTENT_DIR+"podlings.xml")
 
 graduatedProjects = {}
 history = {}
@@ -394,7 +397,7 @@ for k in sorted(projectNames, key=str.lo
     print("DEBUG: Will try alternate names: {0}".format(projects[k]['resourceNames']))
 
   # parse their project status file to extract specific information
-  statusFile = "site-author/projects/{0}.xml".format(projectsTable[k]['statusFileName'])
+  statusFile = SITE_CONTENT_DIR+"projects/{0}.xml".format(projectsTable[k]['statusFileName'])
   if os.path.exists(statusFile):
     dom = xml.dom.minidom.parse(statusFile)
     # get the project info hints
@@ -642,7 +645,7 @@ for k in sorted(projectNames, key=str.lo
   projects[k]['mentors'] = projectsTable[k]['mentors']
   projects[k]['startDate'] = projectsTable[k]['startDate']
 
-  statusFile = "site-author/projects/{0}.xml".format(projectsTable[k]['statusFileName'])
+  statusFile = SITE_CONTENT_DIR+"projects/{0}.xml".format(projectsTable[k]['statusFileName'])
   if not os.path.exists(statusFile):
     errorMsg = "{0}: Missing status file".format(k)
     print('ERROR:', errorMsg)
@@ -671,7 +674,7 @@ for k in sorted(projectNames, key=str.lo
       projects[k]['entryDate'] = entryDate
 
   # Gather recent updates to their status page.
-  inputFile = "site-author/projects/{0}.xml".format(projects[k]['statusFileName'])
+  inputFile = SITE_CONTENT_DIR+"projects/{0}.xml".format(projects[k]['statusFileName'])
   if optionVerbose:
     print("DEBUG: Parsing svn log for {0} ...".format(inputFile))
   outputString = osExec(['svn', 'log', '--xml', inputFile])
@@ -975,9 +978,9 @@ monthsLong = 'January February March Apr
 nameCurrentReport = "{0}{1}".format(monthsLong[gatherDate.month-1], gatherDate.year)
 urlCurrentReport = "".join(["http://wiki.apache.org/incubator/", nameCurrentReport])
 
-fileList = open('site-author/clutch.txt', 'w')
+fileList = open(SITE_CONTENT_DIR+'clutch.txt', 'w')
 
-fileXmlo1 = open('site-author/clutcho1.ent', encoding='utf-8', mode='w')
+fileXmlo1 = open(SITE_CONTENT_DIR+'clutcho1.ent', encoding='utf-8', mode='w')
 fileXmlo1.write("<!-- generated by clutch; do not edit -->\n")
 if len(otherIssues):
   otherXml = """<li>other issues <a href="#other">listed</a> below for:
"""
@@ -990,7 +993,7 @@ if len(otherIssues):
   fileXmlo1.write(otherXml)
 fileXmlo1.close()
 
-fileXmlt = open('site-author/clutcht.ent', encoding='utf-8', mode='w')
+fileXmlt = open(SITE_CONTENT_DIR+'clutcht.ent', encoding='utf-8', mode='w')
 fileXmlt.write("<!-- generated by clutch; do not edit -->\n")
 tableTopXml = """
         Clutch last gathered: {0} UTC.<br />
@@ -1005,13 +1008,13 @@ reportList2 = ""
 reportList3 = ""
 tableRowCount = 0
 tableRowCountMid = int(len(projects) / 2)
-fileXml = open('site-author/clutchr1.ent', encoding='utf-8', mode='w')
+fileXml = open(SITE_CONTENT_DIR+'clutchr1.ent', encoding='utf-8', mode='w')
 fileXml.write("<!-- generated by clutch; do not edit -->\n")
 for k in sorted(projectNames, key=str.lower):
   tableRowCount += 1
   if tableRowCount == tableRowCountMid:
     fileXml.close()
-    fileXml = open('site-author/clutchr2.ent', encoding='utf-8', mode='w')
+    fileXml = open(SITE_CONTENT_DIR+'clutchr2.ent', encoding='utf-8', mode='w')
     fileXml.write("<!-- generated by clutch; do not edit -->\n")
   fileXml.write('        <tr id="{0}">\n'.format(k))
   fileXml.write('          <td')
@@ -1162,7 +1165,7 @@ fileXml.close()
 # End of rows
 
 # Other issues
-fileXmlo2 = open('site-author/clutcho2.ent', encoding='utf-8', mode='w')
+fileXmlo2 = open(SITE_CONTENT_DIR+'clutcho2.ent', encoding='utf-8', mode='w')
 fileXmlo2.write("<!-- generated by clutch; do not edit -->\n")
 if len(otherIssues):
   otherIssues.sort()
@@ -1175,7 +1178,7 @@ fileXmlo2.close()
 
 mentors = list(mentorsProjects.keys())
 mentors.sort()
-fileXmlm = open('site-author/clutchm.ent', encoding='utf-8', mode='w')
+fileXmlm = open(SITE_CONTENT_DIR+'clutchm.ent', encoding='utf-8', mode='w')
 fileXmlm.write("<!-- generated by clutch; do not edit -->\n")
 for mentor in mentors:
   fileXmlm.write("        <li><strong>{0}</strong>: {1}</li>\n".format(mentor,
', '.join(mentorsProjects[mentor])))
@@ -1183,17 +1186,17 @@ fileXmlm.close()
 
 fileList.close()
 
-fileReport1 = open('site-author/report_due_1.txt', 'w')
+fileReport1 = open(SITE_CONTENT_DIR+'report_due_1.txt', 'w')
 fileReport1.write(reportList1)
 fileReport1.close()
-fileReport2 = open('site-author/report_due_2.txt', 'w')
+fileReport2 = open(SITE_CONTENT_DIR+'report_due_2.txt', 'w')
 fileReport2.write(reportList2)
 fileReport2.close()
-fileReport3 = open('site-author/report_due_3.txt', 'w')
+fileReport3 = open(SITE_CONTENT_DIR+'report_due_3.txt', 'w')
 fileReport3.write(reportList3)
 fileReport3.close()
 
-fileHistory = open('site-author/history/entry.txt', 'w')
+fileHistory = open(SITE_CONTENT_DIR+'history/entry.txt', 'w')
 fileHistory.write('# podlings entered incubation\n')
 sequence = len(history) + 1
 # sorted by date



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


Mime
View raw message