import sys, types
def pt_edit(self, text, content_type):
if content_type:
self.content_type = str(content_type)
if hasattr(text, 'read'):
text = text.read()
self.write(text)
def write(self, text):
assert type(text) in types.StringTypes
if text[:len(self._error_start)] == self._error_start:
errend = text.find('-->')
if errend >= 0:
text = text[errend + 4:]
if self._text != text:
self._text = text
self._cook()
def initialize(context):
from Products.PageTemplates.PageTemplate import PageTemplate
PageTemplate.write = write
PageTemplate.pt_edit = pt_edit
コメント
| Last edited Sat, 09 Sep 2006 14:16:44 +0900 | Edit this page |