incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r1159096 - /incubator/public/trunk/clutch.py
Date Thu, 18 Aug 2011 08:59:30 GMT
Author: crossley
Date: Thu Aug 18 08:59:30 2011
New Revision: 1159096

URL: http://svn.apache.org/viewvc?rev=1159096&view=rev
Log:
Improve handling of inconsistent names for project resources.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1159096&r1=1159095&r2=1159096&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Thu Aug 18 08:59:30 2011
@@ -190,7 +190,7 @@ for token in tokens:
     projects[id]['numberCommitters'] = 0
     projects[id]['numberCommittersNew'] = 0
     # Is it reporting monthly?
-    if group.find('month') >= 0:
+    if (group == 'month'):
       projects[id]['reportingMonthly'] = True
       projects[id]['reportingComments'] = reportingComments
       projects[id]['hasEntryIssues'] = True
@@ -228,7 +228,7 @@ projectNames = projects.keys()
 projectNames.sort(ignorecasecmp)
 for k in projectNames:
   #print "Name: %s" % k
-  if projects[k]['reportingGroup'].find('month') >= 0:
+  if projects[k]['reportingGroup'] == 'month':
     print 'ERROR: %s: missing group' % k
     projects[k]['hasReportingGroup'] = False
 
@@ -267,8 +267,8 @@ for row in table.getElementsByTagName("t
   id = id.replace(' ', '') # strip spaces from project ID
   # handle some inconsistent names
   # FIXME: perhaps need to use resourceName
-  if id.find("manifoldcf") >= 0:
-    id = "manifoldcf"
+  if 'manifoldcf' in id:
+    id = 'manifoldcf'
   values = [getText(td.childNodes) for td in row.getElementsByTagName("td")[1:]]
   description, sponsor, mentors, startDate = values[:4]
 
@@ -489,7 +489,7 @@ for listName in mailLists.names:
     print "DEBUG: listName=%s" % listName
   if listName.find("/") == -1:
     continue
-  if listName.find("-") != -1:
+  if ('-' in listName):
     matchList = re.search(mailListNamesRE, listName)
     try:
       projectMailLists[matchList.group(1)]
@@ -657,21 +657,17 @@ for k in projectNames:
   # e.g. portals-wsrp4j
   tlpSvn = ""
   sponsor = projects[k]['sponsor'].lower()
-  if sponsor.find("?") >= 0:
+  if '?' in sponsor:
     sponsor = "incubator"
-  if sponsor.find("incubator") == -1:
-    if sponsor.find("logging services") >= 0:
+  if not 'incubator' in sponsor:
+    if 'logging services' in sponsor:
       sponsor = "logging"
     tlpSvn = "%(a)s-%(b)s" % {'a': sponsor, 'b': k}
-  if k.find("lucene.net") >= 0:
+  if k == 'lucene.net':
     tlpSvn = "lucene-dot-net"
-  if k.find("manifoldcf") >= 0:
+  if k == 'manifoldcf':
     tlpSvn = "lucene-connectors"
-  if k.find("beanvalidation") >= 0:
-    tlpSvn = "bval"
-  if k.find("openoffice.org") >= 0:
-    tlpSvn = "ooo"
-  for svnGroup in [k, tlpSvn]:
+  for svnGroup in [k, projects[k]['resourceName'], tlpSvn]:
     if svnGroup == "":
       break
     if optionVerbose:
@@ -756,8 +752,6 @@ for k in projectNames:
       print 'INFO: %s: Does not yet have a website' % k
 
   # See if they have a distribution area yet.
-  if k == "beanvalidation":
-    projects[k]['resourceName'] = "bval"
   if optionUseClutchState and projects[k]['hasClutchState'] and state[k]['urlDist']:
     projects[k]['urlDist'] = state[k]['urlDist']
   else:
@@ -1051,7 +1045,7 @@ for k in projectNames:
   output[k] = {}
   output[k]['podlingName'] = projects[k]['name']
 
-  if projects[k]['sponsor'].find("?") >= 0:
+  if '?' in projects[k]['sponsor']:
     fileXml.write('          <td class="issue">%s</td>\n' % projects[k]['sponsor'])
   else:
     fileXml.write('          <td>%s</td>\n' % projects[k]['sponsor'])



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


Mime
View raw message