incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1348395 - /incubator/public/trunk/clutch.py
Date Sat, 09 Jun 2012 13:07:31 GMT
Author: sebb
Date: Sat Jun  9 13:07:31 2012
New Revision: 1348395

URL: http://svn.apache.org/viewvc?rev=1348395&view=rev
Log:
Gather utility functions together

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1348395&r1=1348394&r2=1348395&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Sat Jun  9 13:07:31 2012
@@ -106,7 +106,8 @@ import urllib.request, urllib.error, url
 import xml.dom.minidom
 import argparse
 
-# constants for external data
+# constants for external data ---
+
 REPORTING_SCHEDULE = 'http://wiki.apache.org/incubator/ReportingSchedule?action=raw'
 COMMITTERS_BY_PROJECT = "http://people.apache.org/committers-by-project.html"
 MAIL_LIST_URL = "http://incubator.apache.org/mail/"
@@ -114,7 +115,8 @@ 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
+# Constant for site content location ---
+
 SITE_CONTENT_DIR = 'content/'
 
 parser = argparse.ArgumentParser(description='Gather details about projects currently in
incubation.')
@@ -140,6 +142,8 @@ optionUseClutchState = args.ignoreState 
 # Should we log external requests?
 optionExternal = args.external == True
 
+# Utility functions ----
+
 def logexternal(string):
   if optionExternal:
     print("External: " + string)
@@ -152,6 +156,21 @@ def osExec(list):
   logexternal(" ".join(list))
   return subprocess.Popen(list, stdout=subprocess.PIPE).communicate()[0]
 
+def getText(nodelist):
+  """http://www.python.org/doc/2.5.2/lib/minidom-example.txt"""
+  rc = ""
+  for node in nodelist:
+    if node.nodeType == node.TEXT_NODE:
+      rc = rc + node.data
+  return rc
+
+def normaliseSVNurl(url):
+    rc = url.replace('https://','http://')
+    if not rc[-1] == '/':
+      rc = rc + '/'
+    return rc
+
+
 projects = {} # internal data, derived from ReportingSchedule
 otherIssues = []
 persist = {} # persistent data to be utilised by other tools
@@ -281,14 +300,6 @@ for k in sorted(projectNames, key=str.lo
 
 projectsTable = {} # internal data from podlings.xml
 
-def getText(nodelist):
-  """http://www.python.org/doc/2.5.2/lib/minidom-example.txt"""
-  rc = ""
-  for node in nodelist:
-    if node.nodeType == node.TEXT_NODE:
-      rc = rc + node.data
-  return rc
-
 # Parse the podlings data file
 dom = xml.dom.minidom.parse(SITE_CONTENT_DIR+"podlings.xml")
 
@@ -716,12 +727,6 @@ for entry in dom.getElementsByTagName("e
     if name not in ('trunk', 'public'): # skip non-podling entries
       incubatorSvnDirs["http://svn.apache.org/repos/asf/incubator/{0}/".format(name)] = True
 
-def normaliseSVNurl(url):
-    rc = url.replace('https://','http://')
-    if not rc[-1] == '/':
-      rc = rc + '/'
-    return rc
-
 print("Detect certain resources ...")
 for k in sorted(projectNames, key=str.lower):
   print(k)



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


Mime
View raw message