incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1183058 - /incubator/public/trunk/clutch.py
Date Thu, 13 Oct 2011 20:03:02 GMT
Author: sebb
Date: Thu Oct 13 20:03:02 2011
New Revision: 1183058

URL: http://svn.apache.org/viewvc?rev=1183058&view=rev
Log:
Add option handling

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1183058&r1=1183057&r2=1183058&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Thu Oct 13 20:03:02 2011
@@ -70,15 +70,25 @@ import pprint
 import re
 import urllib2
 import xml.dom.minidom
+import argparse
+
+parser = argparse.ArgumentParser(description='Gather details about projects currently in
incubation.')
+parser.add_argument('--useState', action='store_true', help='whether to use stored state
(true)')
+parser.add_argument('-v', '--verbose', choices=['debug','info', 'error'], default='info',
help='set verbosity')
+args = parser.parse_args()
+
+# Normal level of info
+optionInfo = args.verbose == 'info' 
 
-# FIXME: use proper options
 # Issue some extra debug information.
-optionVerbose = False
+optionVerbose = args.verbose == 'debug'
+if optionVerbose:
+  optionInfo = True
 
 # Use the persistent data to speed operations.
 # Occasionally bad data is cached (e.g. experimenting with developing new code).
 # So need to ignore the cached data and perform all resource availability tests.
-optionUseClutchState = True
+optionUseClutchState = args.useState
 
 projects = {} # internal data
 otherIssues = []
@@ -551,7 +561,8 @@ for k in releases:
     try:
       graduatedProjects[k]
     except KeyError:
-      print 'INFO: %s: dormant/retired project has remains on Incubator mirrors' % k
+      if optionInfo:
+        print 'INFO: %s: dormant/retired project has remains on Incubator mirrors' % k
     else:
       print 'ERROR: %s: graduated project has remains on Incubator mirrors' % k
       errorMsg = """%(a)s: Has graduated, but still has remains on Incubator distribution
mirrors""" % \
@@ -681,7 +692,7 @@ for k in projectNames:
       projects[k]['numberCommitters'] = len(committers.projects[svnGroup])
       projects[k]['committersSvn'] = svnGroup
       break
-  if projects[k]['committersSvn'] == None:
+  if projects[k]['committersSvn'] == None and optionInfo:
     print "INFO: %s: Does not yet have committers accounts" % k
 
   # Detect if they have SVN yet.
@@ -710,7 +721,7 @@ for k in projectNames:
       else:
         projects[k]['urlSvn'] = url
         break
-    if not projects[k]['urlSvn']:
+    if not projects[k]['urlSvn'] and optionInfo:
       print 'INFO: %s: Does not yet have SVN' % k
 
   # Detect if they have Tracker yet.
@@ -734,7 +745,7 @@ for k in projectNames:
       else:
         projects[k]['urlTracker'] = url
         break
-    if not projects[k]['urlTracker']:
+    if not projects[k]['urlTracker'] and optionInfo:
       print 'INFO: %s: Does not yet have an Issue Tracker' % k
 
   # Detect if they have a website yet.
@@ -756,7 +767,7 @@ for k in projectNames:
       else:
         projects[k]['urlWww'] = url
         break
-    if not projects[k]['urlWww']:
+    if not projects[k]['urlWww'] and optionInfo:
       print 'INFO: %s: Does not yet have a website' % k
 
   # See if they have a distribution area yet.
@@ -776,7 +787,8 @@ for k in projectNames:
         projects[k]['urlDist'] = urlMirror
         break
   if not projects[k]['urlDist']:
-    print 'INFO: %s: Does not yet have a distribution area' % k
+    if optionInfo:
+      print 'INFO: %s: Does not yet have a distribution area' % k
   elif optionVerbose:
     print 'DEBUG: dist=%s' % projects[k]['urlDist']
 
@@ -788,7 +800,8 @@ for k in projectNames:
       try:
         keysList[nameDistArea]
       except KeyError:
-        print 'INFO: %s: Does not yet have a PGP KEYS file' % k
+        if optionInfo:
+          print 'INFO: %s: Does not yet have a PGP KEYS file' % k
       else:
         projects[k]['urlKeys'] = keysList[nameDistArea]
   if optionVerbose:
@@ -840,8 +853,9 @@ for k in projectNames:
           try:
             projectMailLists[projectName][listType]
           except:
-            print "INFO: %(a)s: Does not yet have hinted incubator mail list '%(b)s-%(c)s'"
% \
-                {'a': k, 'b': projectName, 'c': listType}
+            if optionInfo:
+              print "INFO: %(a)s: Does not yet have hinted incubator mail list '%(b)s-%(c)s'"
% \
+                  {'a': k, 'b': projectName, 'c': listType}
             projects[k][mailListKey] = ""
           else:
             projects[k][mailListKey] = "http://mail-archives.apache.org/mod_mbox/incubator-%(a)s/"
% \
@@ -868,9 +882,9 @@ for k in projectNames:
     if foundMailLists:
       break
   # End of processing project mail lists.
-  if not projects[k]['hasMailListDev']:
+  if not projects[k]['hasMailListDev'] and optionInfo:
     print "INFO: %s: Does not yet have 'dev' mail list" % k
-  if not projects[k]['hasMailListCommits']:
+  if not projects[k]['hasMailListCommits'] and optionInfo:
     print "INFO: %s: Does not yet have 'commits' mail list" % k
 
 # end of processing



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


Mime
View raw message