[CMF-checkins] CVS: CMF/CMFDefault - Document.py:1.67

Yvo Schubbe y.2004_ at wcm-solutions.de
Wed May 26 15:05:36 EDT 2004


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv10001/CMFDefault

Modified Files:
	Document.py 
Log Message:
- removed some stx cruft


=== CMF/CMFDefault/Document.py 1.66 => 1.67 ===
--- CMF/CMFDefault/Document.py:1.66	Thu Apr 29 12:13:17 2004
+++ CMF/CMFDefault/Document.py	Wed May 26 15:05:35 2004
@@ -21,10 +21,9 @@
 from AccessControl import getSecurityManager
 from Acquisition import aq_base
 from DocumentTemplate.DT_Util import html_quote
-from StructuredText.HTMLWithImages import HTMLWithImages
+from StructuredText.StructuredText import HTML
 
 from Products.CMFCore.PortalContent import PortalContent
-from Products.CMFCore.utils import format_stx
 from Products.CMFCore.utils import keywordsplitter
 
 from DublinCore import DefaultDublinCoreImpl
@@ -80,20 +79,6 @@
     self._setObject(id,o)
 
 
-class CMFHtmlWithImages(HTMLWithImages):
-    """ Special subclass of HTMLWithImages, overriding document() """
-    def document(self, doc, level, output):
-        """\
-        HTMLWithImages.document renders full HTML (head, title, body).  For
-        CMF Purposes, we don't want that.  We just want those nice juicy
-        body parts perfectly rendered.
-        """
-        for c in doc.getChildNodes():
-           getattr(self, self.element_types[c.getNodeName()])(c, level, output)
-
-CMFHtmlWithImages = CMFHtmlWithImages()
-
-
 class Document(PortalContent, DefaultDublinCoreImpl):
     """ A Document - Handles both StructuredText and HTML """
 
@@ -156,7 +141,7 @@
         elif text_format == 'plain':
             self.cooked_text = html_quote(text).replace('\n', '<br />')
         else:
-            self.cooked_text = format_stx(text=text, level=self._stx_level)
+            self.cooked_text = HTML(text, level=self._stx_level, header=0)
 
     security.declareProtected(ModifyPortalContent, 'edit')
     def edit( self
@@ -308,7 +293,7 @@
             or (stx_level == self._stx_level)):
             return self.cooked_text
         else:
-            cooked = format_stx(self.text, stx_level)
+            cooked = HTML(self.text, level=stx_level, header=0)
             if setlevel:
                 self._stx_level = stx_level
                 self.cooked_text = cooked




More information about the CMF-checkins mailing list