[CalendarServer-changes] [5246] CalendarServer/trunk/calendarserver/tools/purge.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 4 11:27:47 PST 2010


Revision: 5246
          http://trac.macosforge.org/projects/calendarserver/changeset/5246
Author:   sagen at apple.com
Date:     2010-03-04 11:27:47 -0800 (Thu, 04 Mar 2010)
Log Message:
-----------
Tweaks to arguments (including removal of --quiet)

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

Modified: CalendarServer/trunk/calendarserver/tools/purge.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/purge.py	2010-03-04 19:19:34 UTC (rev 5245)
+++ CalendarServer/trunk/calendarserver/tools/purge.py	2010-03-04 19:27:47 UTC (rev 5246)
@@ -45,11 +45,10 @@
     print "  Remove old events from the calendar server"
     print ""
     print "options:"
-    print "  -d --days <number>: specify how many days in the past to retain"
+    print "  -d --days <number>: specify how many days in the past to retain (default=365)"
     print "  -f --config <path>: Specify caldavd.plist configuration path"
     print "  -h --help: print this help and exit"
     print "  -n --dry-run: only calculate how many events to purge"
-    print "  -q --quiet: don't prompt for confirmation"
     print "  -v --verbose: print progress information"
     print ""
 
@@ -63,12 +62,11 @@
 
     try:
         (optargs, args) = getopt(
-            sys.argv[1:], "d:f:hnqv", [
+            sys.argv[1:], "d:f:hnv", [
                 "days=",
                 "dry-run",
                 "config=",
                 "help",
-                "quiet",
                 "verbose",
             ],
         )
@@ -81,7 +79,6 @@
     configFileName = None
     days = 365
     dryrun = False
-    prompt = True
     verbose = False
 
     for opt, arg in optargs:
@@ -100,11 +97,7 @@
 
         elif opt in ("-n", "--dry-run"):
             dryrun = True
-            prompt = False
 
-        elif opt in ("-q", "--quiet"):
-            prompt = False
-
         elif opt in ("-f", "--config"):
             configFileName = arg
 
@@ -136,12 +129,6 @@
 
     cutoff = (date.today() - timedelta(days=days)).strftime("%Y%m%dT000000Z")
 
-    if prompt:
-        response = raw_input("Are you sure you want to delete all events older than %d days? (yes/no) " % (days,))
-        if response != "yes":
-            print "Not deleting events"
-            sys.exit(0)
-
     #
     # Start the reactor
     #
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100304/d14d03ed/attachment.html>


More information about the calendarserver-changes mailing list