[CalendarServer-changes] [424] CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/ directory/resource.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Nov 9 21:03:55 PST 2006


Revision: 424
          http://trac.macosforge.org/projects/calendarserver/changeset/424
Author:   wsanchez at apple.com
Date:     2006-11-09 21:03:54 -0800 (Thu, 09 Nov 2006)

Log Message:
-----------
Show more information in render()

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py

Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py	2006-11-10 04:13:56 UTC (rev 423)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py	2006-11-10 05:03:54 UTC (rev 424)
@@ -153,7 +153,16 @@
     ##
 
     def render(self, request):
-        output = (
+        def format_list(method, *args):
+            try:
+                for item in method(*args):
+                    yield " -> %s\n" % (item,)
+                else:
+                    yield " '()\n"
+            except Exception, e:
+                yield "  ** %s **: %s\n" % (e.__class__.__name__, e)
+
+        output = ("".join((
             "Principal resource\n"
             "------------------\n"
             "\n"
@@ -162,8 +171,15 @@
             "GUID: %(guid)s\n"
             "Short name: %(shortName)s\n"
             "Full name: %(fullName)s\n"
-            % self.record.__dict__
-        )
+            % self.record.__dict__,
+            "Principal UID: %s\n" % self.principalUID(),
+            "\nAlternate URIs:\n"         , "".join(format_list(self.alternateURIs)),
+            "\nGroup members:\n"          , "".join(format_list(self.groupMembers)),
+            "\nGroup memberships:\n"      , "".join(format_list(self.groupMemberships)),
+            "\nPrincipal collections:\n"  , "".join(format_list(self.principalCollections, request)),
+            "\nCalendar homes:\n"         , "".join(format_list(self.calendarHomeURLs)),
+            "\nCalendar user addresses:\n", "".join(format_list(self.calendarUserAddresses)),
+        )))
 
         if type(output) == unicode:
             output = output.encode("utf-8")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061109/24b60659/attachment.html


More information about the calendarserver-changes mailing list