[CalendarServer-changes] [692]
CalendarServer/trunk/twistedcaldav/extensions.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Dec 5 11:13:28 PST 2006
Revision: 692
http://trac.macosforge.org/projects/calendarserver/changeset/692
Author: wsanchez at apple.com
Date: 2006-12-05 11:13:27 -0800 (Tue, 05 Dec 2006)
Log Message:
-----------
join a list of strings instead of extending the string.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/extensions.py
Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py 2006-12-05 18:46:51 UTC (rev 691)
+++ CalendarServer/trunk/twistedcaldav/extensions.py 2006-12-05 19:13:27 UTC (rev 692)
@@ -93,7 +93,7 @@
"""
title = "Directory listing for %s" % urllib.unquote(request.path)
- s = """<html>
+ s = ["""<html>
<head>
<title>%(title)s</title>
<style>
@@ -119,7 +119,7 @@
<table>
<tr><th>Filename</th> <th>Size</th> <th>Last Modified</th> <th>File Type</th></tr>
-""" % { "title": urllib.unquote(request.uri) }
+""" % { "title": urllib.unquote(request.uri) }]
even = False
children = list(self.listChildren())
@@ -150,23 +150,23 @@
return value
# FIXME: gray out resources that are not readable
- s += """<tr class="%(even)s"><td><a href="%(url)s">%(name)s</a></td> <td align="right">%(size)s</td> <td>%(lastModified)s</td><td>%(type)s</td></tr>\n""" % {
+ s.append("""<tr class="%(even)s"><td><a href="%(url)s">%(name)s</a></td> <td align="right">%(size)s</td> <td>%(lastModified)s</td><td>%(type)s</td></tr>\n""" % {
"even": even and "even" or "odd",
"url": url,
"name": name,
"size": orNone(size),
"lastModified": orNone(lastModified, f=lambda t: time.strftime("%Y-%b-%d %H:%M", time.localtime(t))),
"type": orNone(contentType, default="-", f=lambda m: "%s/%s %s" % (m.mediaType, m.mediaSubtype, m.params)),
- }
+ })
even = not even
- s += """
+ s.append("""
</table>
</div>
</body>
</html>
-"""
+""")
- response = Response(200, {}, s)
+ response = Response(200, {}, "".join(s))
response.headers.setHeader("content-type", MimeType("text", "html"))
return response
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061205/f411ad73/attachment.html
More information about the calendarserver-changes
mailing list