[Zope3-checkins] CVS: Zope3/src/zope/app/content - zpt.py:1.7

Sidnei da Silva sidnei@x3ng.com.br
Wed, 2 Apr 2003 13:38:51 -0500


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv22100

Modified Files:
	zpt.py 
Log Message:
Enabling source view under @@source.html for ZPT pages. Were using this for Moztop.

=== Zope3/src/zope/app/content/zpt.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/content/zpt.py:1.6	Mon Feb  3 10:08:32 2003
+++ Zope3/src/zope/app/content/zpt.py	Wed Apr  2 13:38:21 2003
@@ -155,3 +155,14 @@
         # XXX Hm, how does one figure out an ftp encoding. Waaa.
         r.setSource(unicode(data), content_type or 'text/html')
         return r
+
+class ZPTSourceView:
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def __str__(self):
+        return self.context.getSource()
+
+    __call__ = __str__