[CalendarServer-changes] [5631] CalendarServer/trunk/calendarserver/tools/fixcalendardata.py

source_changes at macosforge.org source_changes at macosforge.org
Thu May 20 10:57:41 PDT 2010


Revision: 5631
          http://trac.macosforge.org/projects/calendarserver/changeset/5631
Author:   cdaboo at apple.com
Date:     2010-05-20 10:57:38 -0700 (Thu, 20 May 2010)
Log Message:
-----------
Add option to turn logging on/off.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/fixcalendardata.py

Modified: CalendarServer/trunk/calendarserver/tools/fixcalendardata.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/fixcalendardata.py	2010-05-20 16:52:00 UTC (rev 5630)
+++ CalendarServer/trunk/calendarserver/tools/fixcalendardata.py	2010-05-20 17:57:38 UTC (rev 5631)
@@ -34,6 +34,8 @@
 totalErrors = 0
 totalScanned = 0
 
+verbose = False
+
 def usage(e=None):
     if e:
         print e
@@ -49,6 +51,7 @@
     print "  -h --help: print this help and exit"
     print "  -f --config: Specify caldavd.plist configuration path"
     print "  -o <path>: path to file for scan results [problems.txt]"
+    print "  -v: print each calendar home scanned"
     print "  --scan: Scan for problems"
     print "  --fix: Apply fixes"
     print ""
@@ -97,7 +100,8 @@
                             scanCalendarHome(basePath, calendarHome, scanFile, doFix)
 
 def scanCalendarHome(basePath, calendarHome, scanFile, doFix):
-    print "Scanning: %s" % (calendarHome,)
+    if verbose:
+        print "Scanning: %s" % (calendarHome,)
     
     for item in os.listdir(calendarHome):
         calendarPath = os.path.join(calendarHome, item)
@@ -293,7 +297,7 @@
     doFix = False
     
     # Parse command line options
-    opts, _ignore_args = getopt.getopt(sys.argv[1:], "f:ho:", ["config", "scan", "fix", "help",])
+    opts, _ignore_args = getopt.getopt(sys.argv[1:], "f:ho:v", ["config", "scan", "fix", "help",])
     for option, value in opts:
         if option in ("-h", "--help"):
             usage()
@@ -303,6 +307,8 @@
                 usage("Path does not exist: %s" % (plistPath,))
         elif option == "-o":
             scanPath = value
+        elif option == "-v":
+            verbose = True
         elif option == "--scan":
             doScan = True
         elif option == "--fix":
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100520/b2e787b1/attachment.html>


More information about the calendarserver-changes mailing list