[CalendarServer-changes] [7935] CalendarServer/branches/users/glyph/imip-and-admin-html/ calendarserver/webadmin/resource.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Aug 11 21:46:40 PDT 2011
Revision: 7935
http://trac.macosforge.org/projects/calendarserver/changeset/7935
Author: glyph at apple.com
Date: 2011-08-11 21:46:40 -0700 (Thu, 11 Aug 2011)
Log Message:
-----------
move off stub renderers to new class, still failing
Modified Paths:
--------------
CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/resource.py
Modified: CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/resource.py
===================================================================
--- CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/resource.py 2011-08-12 04:46:29 UTC (rev 7934)
+++ CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/resource.py 2011-08-12 04:46:40 UTC (rev 7935)
@@ -40,9 +40,11 @@
from twext.web2.http import Response
from twisted.python.modules import getModule
from twext.web2.http_headers import MimeType
+from zope.interface.declarations import implements
from twext.web2.stream import MemoryStream
from twext.web2.dav import davxml
+from twisted.web.iweb import ITemplateLoader
from twisted.web.template import (
Element, renderer, XMLFile, flattenString
)
@@ -151,11 +153,36 @@
Renderer which fills slots for details of the resource selected by
the resourceId request parameter.
"""
+ return DetailsElement(tag)
+
+
+
+class stan(object):
+ """
+ L{ITemplateLoader} wrapper for an existing tag, in the style of Nevow's
+ 'stan' loader.
+ """
+ implements(ITemplateLoader)
+
+ def __init__(self, tag):
+ self.tag = tag
+
+
+ def load(self):
+ return self.tag
+
+
+
+class DetailsElement(Element):
+
+ def __init__(self, tag):
# FIXME IMPLEMENT
- return tag.fillSlots(resourceTitle="",
- resourceId="",
- davPropertyName="")
+ tag.fillSlots(resourceTitle="",
+ resourceId="",
+ davPropertyName="")
+ super(DetailsElement, self).__init__(loader=stan(tag))
+
@renderer
def propertyParseError(self, request, tag):
"""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110811/dd80d1c6/attachment.html>
More information about the calendarserver-changes
mailing list