[CalendarServer-changes] [9994] CalDAVClientLibrary/trunk/caldavclientlibrary/browser

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 29 09:47:31 PDT 2012


Revision: 9994
          http://trac.calendarserver.org//changeset/9994
Author:   cdaboo at apple.com
Date:     2012-10-29 09:47:31 -0700 (Mon, 29 Oct 2012)
Log Message:
-----------
Fix some URL quoting issues.

Modified Paths:
--------------
    CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py
    CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/ls.py
    CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/props.py

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py	2012-10-27 15:42:40 UTC (rev 9993)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py	2012-10-29 16:47:31 UTC (rev 9994)
@@ -1,4 +1,4 @@
-##
+# #
 # Copyright (c) 2007-2010 Apple Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-##
+# #
 
 from caldavclientlibrary.browser import utils
 from caldavclientlibrary.browser.command import CommandError
@@ -22,6 +22,7 @@
 import os
 import readline
 import traceback
+import urllib
 
 class BaseShell(object):
 
@@ -160,7 +161,7 @@
     def complete(self, text, state):
 
         # If there is no space in the text we complete a command
-        #print "complete: %s %d" % (text, state)
+        # print "complete: %s %d" % (text, state)
         results = []
         check = readline.get_line_buffer()[:readline.get_endidx()].lstrip()
         checklen = len(check)
@@ -178,14 +179,14 @@
 
     def wdcomplete(self, text):
 
-        #print "\nwdcomplete: %s" % (text,)
+        # print "\nwdcomplete: %s" % (text,)
 
         # Look at cache and return that
-        if self.last_wd_complete[0] == text:
-            return self.last_wd_complete[1]
+        # if self.last_wd_complete[0] == text:
+        #    return self.last_wd_complete[1]
 
         # Look for relative vs absolute
-        if text[0] == "/":
+        if text and text[0] == "/":
             dirname, _ignore_child = os.path.split(text)
             path = dirname
             if not path.endswith("/"):
@@ -200,18 +201,18 @@
             if not path.endswith("/"):
                 path += "/"
 
-        #print "pdc: %s, %s, %s, %s" % (self.wd, path, dirname, child)
+        # print "pdc: %s, %s, %s" % (self.wd, path, dirname)
         resource = URL(url=path)
 
         props = (davxml.resourcetype,)
         results = self.account.session.getPropertiesOnHierarchy(resource, props)
-        #print results.keys()
-        results = [result[pathlen:] for result in results.iterkeys() if len(result) > pathlen]
-        #print results
+        results = [urllib.unquote(result) for result in results.iterkeys()]
+        results = [result[pathlen:] for result in results if len(result) > pathlen]
+        # print results
         if text:
             textlen = len(text)
             results = [result for result in results if result[:textlen] == text]
-            #print results
+            # print results
 
         self.last_wd_complete = (text, results,)
         return results

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/ls.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/ls.py	2012-10-27 15:42:40 UTC (rev 9993)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/ls.py	2012-10-29 16:47:31 UTC (rev 9994)
@@ -22,6 +22,7 @@
 import os
 import getopt
 import shlex
+import urllib
 
 class Cmd(Command):
 
@@ -104,6 +105,7 @@
         items.sort()
         lines = []
         for rurl in items:
+            rurl = urllib.unquote(rurl)
             if rurl == path:
                 continue
             line = []

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/props.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/props.py	2012-10-27 15:42:40 UTC (rev 9993)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/browser/commands/props.py	2012-10-29 16:47:31 UTC (rev 9994)
@@ -32,7 +32,7 @@
     def execute(self, name, options):
 
         names = False
-        all = False
+        all_props = False
         xmllist = False
         path = None
 
@@ -41,7 +41,7 @@
         for name, _ignore_value in opts:
 
             if name == "-a":
-                all = True
+                all_props = True
             elif name == "-l":
                 xmllist = True
             elif name == "-n":
@@ -69,7 +69,7 @@
             results = self.shell.account.session.getPropertyNames(resource)
             print "    Properties: %s" % (utils.printList(results),)
         else:
-            if all:
+            if all_props:
                 props = None
             else:
                 props = self.shell.account.session.getPropertyNames(resource)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121029/a73fe571/attachment.html>


More information about the calendarserver-changes mailing list