incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r710016 - in /incubator/public/trunk: clutch.py site-author/clutch.xml site-publish/clutch.html
Date Mon, 03 Nov 2008 07:30:44 GMT
Author: crossley
Date: Sun Nov  2 23:30:44 2008
New Revision: 710016

URL: http://svn.apache.org/viewvc?rev=710016&view=rev
Log:
If already detected certain resources (e.g. website) on a previous Clutch run, then reuse
this cache data, and skip detection.

Modified:
    incubator/public/trunk/clutch.py
    incubator/public/trunk/site-author/clutch.xml
    incubator/public/trunk/site-publish/clutch.html

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=710016&r1=710015&r2=710016&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Sun Nov  2 23:30:44 2008
@@ -49,6 +49,7 @@
 # FIXME: Add option "--verbose".
 # FIXME: Detect if they have SVN repo yet.
 #        - http://svn.apache.org/repos/asf/incubator/* ensure more than ".."
+# FIXME: Similarly with website. Ensure that there is some content length.
 # FIXME: See some other suggestions on the general@ list.
 # FIXME: See some other suggestions in issue INCUBATOR-78.
 
@@ -62,7 +63,7 @@
 import xml.dom.minidom
 
 projects = {} # internal data
-output = {} # output data to be utilised by other tools
+output = {} # output persistent data to be utilised by other tools
 
 gatherDate = datetime.datetime.utcnow()
 gatherDateString = datetime.datetime.utcnow().ctime()
@@ -82,6 +83,12 @@
 mailListNameRE = re.compile("^([a-z]+)-([-a-z0-9]+)")
 newCommitterRE = re.compile("[nN]ew committer")
 
+# Import the persistent data.
+# This enables us to skip detection of website etc. if already detected.
+inputFile = open('clutch.pkl', 'rb')
+state = pickle.load(inputFile)
+inputFile.close()
+
 def ignorecasecmp(left, right):
   return cmp(left.upper(), right.upper())
 
@@ -155,6 +162,13 @@
       projects[id]['reportingMonthly'] = True
       projects[id]['reportingComments'] = reportingComments
       projects[id]['hasEntryIssues'] = True
+    # See if we can use some persistent data, i.e. not new during this run.
+    try:
+      state[id]
+    except KeyError:
+      projects[id]['hasClutchState'] = False
+    else:
+      projects[id]['hasClutchState'] = True
 
   # Add their group.
   # If this still equals "month" at end, then there is a schedule error.
@@ -491,70 +505,82 @@
   # Detect if they have SVN yet.
   # First, try the url from their status page
   # then, try a standard url.
-  urlSvnDefault = "http://svn.apache.org/repos/asf/incubator/%s/" % projects[k]['statusFileName']
-  if urlSvnDefault == projects[k]['urlSvn']:
-    urlSvnDefault = ""
-  for url in [projects[k]['urlSvn'], urlSvnDefault]:
-    if url == "":
-      continue
-    try:
-      urllib2.urlopen(url)
-    except IOError:
-      projects[k]['urlSvn'] = ""
-    else:
-      projects[k]['urlSvn'] = url
-      break
-  if not projects[k]['urlSvn']:
-    print 'INFO: %s: Does not yet have SVN' % k
+  if projects[k]['hasClutchState'] and state[k]['urlSvn']:
+    projects[k]['urlSvn'] = state[k]['urlSvn']
+  else:
+    urlSvnDefault = "http://svn.apache.org/repos/asf/incubator/%s/" % projects[k]['statusFileName']
+    if urlSvnDefault == projects[k]['urlSvn']:
+      urlSvnDefault = ""
+    for url in [projects[k]['urlSvn'], urlSvnDefault]:
+      if url == "":
+        continue
+      try:
+        urllib2.urlopen(url)
+      except IOError:
+        projects[k]['urlSvn'] = ""
+      else:
+        projects[k]['urlSvn'] = url
+        break
+    if not projects[k]['urlSvn']:
+      print 'INFO: %s: Does not yet have SVN' % k
 
   # Detect if they have Tracker yet.
   # First, try the url from their status page
   # then, try a standard url.
-  urlTrackerDefault = "http://issues.apache.org/jira/browse/%s/" % projects[k]['statusFileName'].upper()
-  if urlTrackerDefault == projects[k]['urlTracker']:
-    urlTrackerDefault = ""
-  for url in [projects[k]['urlTracker'], urlTrackerDefault]:
-    if url == "":
-      continue
-    try:
-      urllib2.urlopen(url)
-    except IOError:
-      projects[k]['urlTracker'] = ""
-    else:
-      projects[k]['urlTracker'] = url
-      break
-  if not projects[k]['urlTracker']:
-    print 'INFO: %s: Does not yet have an Issue Tracker' % k
+  if projects[k]['hasClutchState'] and state[k]['urlTracker']:
+    projects[k]['urlTracker'] = state[k]['urlTracker']
+  else:
+    urlTrackerDefault = "http://issues.apache.org/jira/browse/%s/" % projects[k]['statusFileName'].upper()
+    if urlTrackerDefault == projects[k]['urlTracker']:
+      urlTrackerDefault = ""
+    for url in [projects[k]['urlTracker'], urlTrackerDefault]:
+      if url == "":
+        continue
+      try:
+        urllib2.urlopen(url)
+      except IOError:
+        projects[k]['urlTracker'] = ""
+      else:
+        projects[k]['urlTracker'] = url
+        break
+    if not projects[k]['urlTracker']:
+      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
   # then, try a standard url.
-  urlWwwDefault = "http://incubator.apache.org/%s/" % projects[k]['statusFileName']
-  if urlWwwDefault == projects[k]['urlWww']:
-    urlWwwDefault = ""
-  for url in [projects[k]['urlWww'], urlWwwDefault]:
-    if url == "":
-      continue
-    try:
-      urllib2.urlopen(url)
-    except IOError:
-      projects[k]['urlWww'] = ""
-    else:
-      projects[k]['urlWww'] = url
-      break
-  if not projects[k]['urlWww']:
-    print 'INFO: %s: Does not yet have a website' % k
+  if projects[k]['hasClutchState'] and state[k]['urlWww']:
+    projects[k]['urlWww'] = state[k]['urlWww']
+  else:
+    urlWwwDefault = "http://incubator.apache.org/%s/" % projects[k]['statusFileName']
+    if urlWwwDefault == projects[k]['urlWww']:
+      urlWwwDefault = ""
+    for url in [projects[k]['urlWww'], urlWwwDefault]:
+      if url == "":
+        continue
+      try:
+        urllib2.urlopen(url)
+      except IOError:
+        projects[k]['urlWww'] = ""
+      else:
+        projects[k]['urlWww'] = url
+        break
+    if not projects[k]['urlWww']:
+      print 'INFO: %s: Does not yet have a website' % k
 
   # See if they have a distribution yet.
   # FIXME: Probably need to instead get info from roberts's "audit" data.
-  url = "http://www.apache.org/dist/incubator/%s/" % \
-      projects[k]['statusFileName']
-  try:
-    urllib2.urlopen(url)
-  except IOError:
-    print 'INFO: %s: Does not yet have a distribution area' % k
+  if projects[k]['hasClutchState'] and state[k]['urlDist']:
+    projects[k]['urlDist'] = state[k]['urlDist']
   else:
-    projects[k]['urlDist'] = url
+    url = "http://www.apache.org/dist/incubator/%s/" % \
+        projects[k]['statusFileName']
+    try:
+      urllib2.urlopen(url)
+    except IOError:
+      print 'INFO: %s: Does not yet have a distribution area' % k
+    else:
+      projects[k]['urlDist'] = url
 
   # Detect mail lists established
   # First, try the list names from their status page

Modified: incubator/public/trunk/site-author/clutch.xml
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-author/clutch.xml?rev=710016&r1=710015&r2=710016&view=diff
==============================================================================
--- incubator/public/trunk/site-author/clutch.xml (original)
+++ incubator/public/trunk/site-author/clutch.xml Sun Nov  2 23:30:44 2008
@@ -101,7 +101,7 @@
         </li>
       </ul>
       <p>
-        Clutch last gathered: Mon Nov  3 01:45:28 2008 UTC.<br />
+        Clutch last gathered: Mon Nov  3 07:15:40 2008 UTC.<br />
         Number of podlings in incubation: 34
       </p>
       <table id="clutch">

Modified: incubator/public/trunk/site-publish/clutch.html
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/clutch.html?rev=710016&r1=710015&r2=710016&view=diff
==============================================================================
--- incubator/public/trunk/site-publish/clutch.html (original)
+++ incubator/public/trunk/site-publish/clutch.html Sun Nov  2 23:30:44 2008
@@ -190,7 +190,7 @@
         </li>
       </ul>
 <p>
-        Clutch last gathered: Mon Nov  3 01:45:28 2008 UTC.<br />
+        Clutch last gathered: Mon Nov  3 07:15:40 2008 UTC.<br />
         Number of podlings in incubation: 34
       </p>
 <table id="clutch" class="colortable" width="100%">



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


Mime
View raw message