[CalendarServer-changes] [819]
CalendarServer/trunk/twistedcaldav/extensions.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Dec 12 16:48:19 PST 2006
Revision: 819
http://trac.macosforge.org/projects/calendarserver/changeset/819
Author: wsanchez at apple.com
Date: 2006-12-12 16:48:19 -0800 (Tue, 12 Dec 2006)
Log Message:
-----------
more render tweakage
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/extensions.py
Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py 2006-12-13 00:23:20 UTC (rev 818)
+++ CalendarServer/trunk/twistedcaldav/extensions.py 2006-12-13 00:48:19 UTC (rev 819)
@@ -110,22 +110,22 @@
return response
def directoryStyleSheet(self):
- return """
-th, .even td, .odd td { padding-right: 0.5em; font-family: monospace}
-.even-dir { background-color: #efe0ef }
-.even { background-color: #eee }
-.odd-dir {background-color: #f0d0ef }
-.odd { background-color: #dedede }
-.icon { text-align: center }
-.listing {
- margin-left: auto;
- margin-right: auto;
- width: 50%%;
- padding: 0.1em;
-}
-body { border: 0; padding: 0; margin: 0; background-color: #efefef;}
-h1 {padding: 0.1em; background-color: #777; color: white; border-bottom: thin white dashed;}
-"""
+ return (
+ "th, .even td, .odd td { padding-right: 0.5em; font-family: monospace}"
+ ".even-dir { background-color: #efe0ef }"
+ ".even { background-color: #eee }"
+ ".odd-dir {background-color: #f0d0ef }"
+ ".odd { background-color: #dedede }"
+ ".icon { text-align: center }"
+ ".listing {"
+ "margin-left: auto;"
+ "margin-right: auto;"
+ "width: 50%%;"
+ "padding: 0.1em;"
+ "}"
+ "body { border: 0; padding: 0; margin: 0; background-color: #efefef;}"
+ "h1 {padding: 0.1em; background-color: #777; color: white; border-bottom: thin white dashed;}"
+ )
def renderDirectory(self, request):
"""
@@ -134,22 +134,22 @@
title = "Directory listing for %s" % urllib.unquote(request.path)
output = [
-"""<html>
-<head>
-<title>%(title)s</title>
-<style>%(style)s</style>
-</head>
-<body>
-<div class="directory-listing">
-<h1>%(title)s</h1>
-<table>
+ """<html>"""
+ """<head>"""
+ """<title>%(title)s</title>"""
+ """<style>%(style)s</style>"""
+ """</head>"""
+ """<body>"""
+ """<div class="directory-listing">"""
+ """<h1>%(title)s</h1>"""
+ """<table>"""
+ """<tr><th>Filename</th> <th>Size</th> <th>Last Modified</th> <th>File Type</th></tr>"""
+ % {
+ "title": urllib.unquote(request.uri),
+ "style": self.directoryStyleSheet(),
+ }
+ ]
-<tr><th>Filename</th> <th>Size</th> <th>Last Modified</th> <th>File Type</th></tr>
-""" % {
- "title": urllib.unquote(request.uri),
- "style": self.directoryStyleSheet(),
-}]
-
even = False
for name in sorted(self.listChildren()):
child = self.getChild(name)
@@ -183,7 +183,7 @@
"""<td align="right">%(size)s</td>"""
"""<td>%(lastModified)s</td>"""
"""<td>%(type)s</td>"""
- """</tr>\n"""
+ """</tr>"""
% {
"even": even and "even" or "odd",
"url": url,
@@ -194,12 +194,7 @@
}
)
even = not even
- output.append("""
-</table>
-</div>
-</body>
-</html>
-""")
+ output.append("</table></div></body></html>")
response = Response(200, {}, "".join(output))
response.headers.setHeader("content-type", MimeType("text", "html"))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061212/a9852910/attachment.html
More information about the calendarserver-changes
mailing list