[CalendarServer-changes] [14806] CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/ recovertrash.py

source_changes at macosforge.org source_changes at macosforge.org
Tue May 19 17:03:29 PDT 2015


Revision: 14806
          http://trac.calendarserver.org//changeset/14806
Author:   sagen at apple.com
Date:     2015-05-19 17:03:29 -0700 (Tue, 19 May 2015)
Log Message:
-----------
Now you can recovertrash by passing multiple individual recovery ids, or 'all'

Modified Paths:
--------------
    CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/recovertrash.py

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/recovertrash.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/recovertrash.py	2015-05-19 23:53:53 UTC (rev 14805)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/recovertrash.py	2015-05-20 00:03:29 UTC (rev 14806)
@@ -40,21 +40,20 @@
 
         recoveryID = None
         mode = "event"
-        opts, args = getopt.getopt(shlex.split(options), "cr:")
+        opts, args = getopt.getopt(shlex.split(options), "c")
 
         for name, value in opts:
 
-            if name == "-r":
-                recoveryID = value
-            elif name == "-c":
+            if name == "-c":
                 mode = "collection"
             else:
                 print("Unknown option: {}".format(name))
                 print self.usage(cmdname)
                 raise WrongOptions
 
-        resource = URL(url="{}?action=recovertrash&mode={}&id={}".format(homepath, mode, recoveryID))
-        self.shell.account.session.writeData(resource, None, None, method="POST")
+        for recoveryID in args:
+            resource = URL(url="{}?action=recovertrash&mode={}&id={}".format(homepath, mode, recoveryID))
+            self.shell.account.session.writeData(resource, None, None, method="POST")
 
         return True
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150519/24edcac2/attachment.html>


More information about the calendarserver-changes mailing list