[CalendarServer-changes] [11240] CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py

source_changes at macosforge.org source_changes at macosforge.org
Thu May 23 08:55:48 PDT 2013


Revision: 11240
          http://trac.calendarserver.org//changeset/11240
Author:   cdaboo at apple.com
Date:     2013-05-23 08:55:48 -0700 (Thu, 23 May 2013)
Log Message:
-----------
Make sure command completion is restored when exiting a sub-shell.

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

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py	2013-05-23 15:55:11 UTC (rev 11239)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/browser/baseshell.py	2013-05-23 15:55:48 UTC (rev 11240)
@@ -68,6 +68,7 @@
             readline.clear_history()
             map(readline.add_history, self.history)
 
+        old_completer = readline.get_completer()
         readline.set_completer(self.complete)
         readline.parse_and_bind("bind ^I rl_complete")
 
@@ -88,6 +89,8 @@
             except Exception, e:
                 traceback.print_exc()
 
+        readline.set_completer(old_completer)
+
         # Restore previous history
         if self.preserve_history:
             self.saveHistory()
@@ -169,7 +172,7 @@
         if " " not in check:
             for cmd in self.commands:
                 if cmd[:checklen] == check:
-                    results.append(cmd)
+                    results.append(cmd + " ")
         else:
             cmd, rest = check.split(" ", 1)
             if cmd in self.commands:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130523/c2ff0ad9/attachment.html>


More information about the calendarserver-changes mailing list