incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1349056 - /incubator/public/trunk/clutch.py
Date Mon, 11 Jun 2012 22:43:12 GMT
Author: sebb
Date: Mon Jun 11 22:43:12 2012
New Revision: 1349056

URL: http://svn.apache.org/viewvc?rev=1349056&view=rev
Log:
Standardise spacing - the rest of the file uses 2 spaces for indentation.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1349056&r1=1349055&r2=1349056&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Mon Jun 11 22:43:12 2012
@@ -312,63 +312,63 @@ graduates = []
 
 print("Gather data from podlings.xml ...")
 for row in dom.getElementsByTagName("podling"):
- name = row.getAttribute("name").strip()
- id = name.lower()
- id = id.replace(' ', '') # strip spaces from project ID
- startDate = row.getAttribute("startdate")
- if row.getAttribute("status") == 'graduated':
-  resource = row.getAttribute("resource")
-  graduatedProjects[resource.lower()] = True
- if row.getAttribute("status") == 'current':
-  #print("Name: " + name)
-  # Some projects use an alternate short resource name
-  # rather than their project name
-  for alias in row.getAttribute("resourceAliases").split(','):
-    if alias != '':
-      projects[id]['resourceNames'].append(alias)
-  fileBaseName = row.getAttribute("resource")
-  sponsor = row.getAttribute("sponsor")
-  if row.getElementsByTagName("graduating").length > 0:
-    graduates.append(id)
-  description = getText(row.getElementsByTagName("description"))
-  mentors = [mentor.firstChild.data.strip() for mentor in row.getElementsByTagName("mentor")]
-
-  if id in projectsTable:
-    print("ERROR: {0}: row exists".format(id))
-  else:
-    projectsTable[id] = {}
-    projectsTable[id]['name'] = name
-    projectsTable[id]['description'] = description
-    projectsTable[id]['sponsor'] = sponsor
-    projectsTable[id]['startDate'] = startDate
-    projectsTable[id]['statusFileName'] = fileBaseName
-    projectsTable[id]['mentors'] = mentors
+  name = row.getAttribute("name").strip()
+  id = name.lower()
+  id = id.replace(' ', '') # strip spaces from project ID
+  startDate = row.getAttribute("startdate")
+  if row.getAttribute("status") == 'graduated':
+    resource = row.getAttribute("resource")
+    graduatedProjects[resource.lower()] = True
+  if row.getAttribute("status") == 'current':
+    #print("Name: " + name)
+    # Some projects use an alternate short resource name
+    # rather than their project name
+    for alias in row.getAttribute("resourceAliases").split(','):
+      if alias != '':
+        projects[id]['resourceNames'].append(alias)
+    fileBaseName = row.getAttribute("resource")
+    sponsor = row.getAttribute("sponsor")
+    if row.getElementsByTagName("graduating").length > 0:
+      graduates.append(id)
+    description = getText(row.getElementsByTagName("description"))
+    mentors = [mentor.firstChild.data.strip() for mentor in row.getElementsByTagName("mentor")]
 
-    # determine projects for each mentor
-    for mentor in projectsTable[id]['mentors']:
-      try:
-        mentorsProjects[mentor]
-      except KeyError:
-        mentorsProjects[mentor] = []
-      mentorsProjects[mentor].append(projectsTable[id]['name'])
- history[id] = {}
- history[id]['name'] = name
- match = re.search(startDateRE, startDate)
- if match:
-   if match.group(3) != None:
-     entryDateDay = int(match.group(3))
-   else:
-     entryDateDay = 1
-   if match.group(2) != None:
-     entryDateMonth = int(match.group(2))
-   else:
-     entryDateMonth = 1
-   try:
-     entryDate = datetime.datetime(int(match.group(1)), entryDateMonth, entryDateDay)
-   except ValueError:
-     print("ERROR: {0}: ValueError with date".format(id))
-   else:
-     history[id]['startDate'] = entryDate
+    if id in projectsTable:
+      print("ERROR: {0}: row exists".format(id))
+    else:
+      projectsTable[id] = {}
+      projectsTable[id]['name'] = name
+      projectsTable[id]['description'] = description
+      projectsTable[id]['sponsor'] = sponsor
+      projectsTable[id]['startDate'] = startDate
+      projectsTable[id]['statusFileName'] = fileBaseName
+      projectsTable[id]['mentors'] = mentors
+
+      # determine projects for each mentor
+      for mentor in projectsTable[id]['mentors']:
+        try:
+          mentorsProjects[mentor]
+        except KeyError:
+          mentorsProjects[mentor] = []
+        mentorsProjects[mentor].append(projectsTable[id]['name'])
+  history[id] = {}
+  history[id]['name'] = name
+  match = re.search(startDateRE, startDate)
+  if match:
+    if match.group(3) != None:
+      entryDateDay = int(match.group(3))
+    else:
+      entryDateDay = 1
+    if match.group(2) != None:
+      entryDateMonth = int(match.group(2))
+    else:
+      entryDateMonth = 1
+    try:
+      entryDate = datetime.datetime(int(match.group(1)), entryDateMonth, entryDateDay)
+    except ValueError:
+      print("ERROR: {0}: ValueError with date".format(id))
+    else:
+      history[id]['startDate'] = entryDate
 
 dom.unlink()
 



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


Mime
View raw message