[CalendarServer-changes] [9137] CalendarServer/trunk/calendarserver/tools/shell
source_changes at macosforge.org
source_changes at macosforge.org
Mon Apr 16 16:32:49 PDT 2012
Revision: 9137
http://trac.macosforge.org/projects/calendarserver/changeset/9137
Author: wsanchez at apple.com
Date: 2012-04-16 16:32:49 -0700 (Mon, 16 Apr 2012)
Log Message:
-----------
test_completeFilesLevelOneSlash works now
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/shell/cmd.py
CalendarServer/trunk/calendarserver/tools/shell/test/test_cmd.py
Modified: CalendarServer/trunk/calendarserver/tools/shell/cmd.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell/cmd.py 2012-04-16 23:20:48 UTC (rev 9136)
+++ CalendarServer/trunk/calendarserver/tools/shell/cmd.py 2012-04-16 23:32:49 UTC (rev 9137)
@@ -153,10 +153,14 @@
token = tokens[-1]
- if "/" in token:
- raise NotImplementedError("Path completion not fully implemented.")
+ i = token.rfind("/")
+ if i == -1:
+ # No "/" in token
+ base = self.wd
+ word = token
else:
- base = self.wd
+ base = (yield self.wd.locate(token[:i].split("/")))
+ word = token[i+1:]
files = (
entry.toString()
@@ -167,7 +171,7 @@
if len(tokens) == 0:
returnValue(files)
else:
- returnValue(self.complete(token, files))
+ returnValue(self.complete(word, files))
class Commands(CommandsBase):
Modified: CalendarServer/trunk/calendarserver/tools/shell/test/test_cmd.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell/test/test_cmd.py 2012-04-16 23:20:48 UTC (rev 9136)
+++ CalendarServer/trunk/calendarserver/tools/shell/test/test_cmd.py 2012-04-16 23:32:49 UTC (rev 9137)
@@ -145,8 +145,6 @@
("/groups", ["/"]),
))
- test_completeFilesLevelOneSlash.todo = "Doesn't work yet"
-
def test_completeFilesDirectory(self):
return self._test_completeFiles((
("users/" , ["wsanchez", "admin"]), # FIXME: Look up users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120416/0d0e84ad/attachment.html>
More information about the calendarserver-changes
mailing list