[CalendarServer-changes] [9941] CalendarServer/trunk/calendarserver/tools/shell/vfs.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 15 14:26:00 PDT 2012


Revision: 9941
          http://trac.calendarserver.org//changeset/9941
Author:   wsanchez at apple.com
Date:     2012-10-15 14:26:00 -0700 (Mon, 15 Oct 2012)
Log Message:
-----------
Add displayname to calendar listing.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/shell/vfs.py

Modified: CalendarServer/trunk/calendarserver/tools/shell/vfs.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell/vfs.py	2012-10-15 21:25:32 UTC (rev 9940)
+++ CalendarServer/trunk/calendarserver/tools/shell/vfs.py	2012-10-15 21:26:00 UTC (rev 9941)
@@ -462,8 +462,19 @@
     @inlineCallbacks
     def list(self):
         calendars = (yield self.home.calendars())
-        returnValue((ListEntry(self, CalendarFolder, c.name()) for c in calendars))
+        result = []
+        for calendar in calendars:
+            displayName = calendar.displayName()
+            if displayName is None:
+                displayName = "(unset)"
 
+            info = {
+                "Display Name": displayName,
+                "Sync Token"  : (yield calendar.syncToken()),
+            }
+            result.append(ListEntry(self, CalendarFolder, calendar.name(), **info))
+        returnValue(result)
+
     @inlineCallbacks
     def describe(self):
         description = ["Calendar home:\n"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121015/e580243f/attachment.html>


More information about the calendarserver-changes mailing list