[CMF-checkins] CVS: CMF/CMFCore - FSSTXMethod.py:1.11 utils.py:1.55
Yvo Schubbe
y.2004_ at wcm-solutions.de
Wed May 26 15:06:05 EDT 2004
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv10001/CMFCore
Modified Files:
FSSTXMethod.py utils.py
Log Message:
- removed some stx cruft
=== CMF/CMFCore/FSSTXMethod.py 1.10 => 1.11 ===
--- CMF/CMFCore/FSSTXMethod.py:1.10 Thu Apr 29 12:13:16 2004
+++ CMF/CMFCore/FSSTXMethod.py Wed May 26 15:05:34 2004
@@ -17,6 +17,7 @@
import Globals
from AccessControl import ClassSecurityInfo
+from StructuredText.StructuredText import HTML
from permissions import FTPAccess
from permissions import View
@@ -26,7 +27,6 @@
from FSObject import FSObject
from utils import _dtmldir
from utils import expandpath
-from utils import format_stx
class FSSTXMethod( FSObject ):
@@ -98,7 +98,7 @@
def cook( self ):
if not hasattr( self, '_v_cooked' ):
- self._v_cooked = format_stx( text=self.raw )
+ self._v_cooked = HTML(self.raw, level=1, header=0)
return self._v_cooked
_default_template = Globals.HTML( """\
=== CMF/CMFCore/utils.py 1.54 => 1.55 ===
--- CMF/CMFCore/utils.py:1.54 Mon May 17 09:22:47 2004
+++ CMF/CMFCore/utils.py Wed May 26 15:05:34 2004
@@ -47,6 +47,7 @@
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.Expressions import getEngine
from Products.PageTemplates.Expressions import SecureModuleImporter
+from StructuredText.StructuredText import HTML
from exceptions import AccessControl_Unauthorized
from exceptions import NotFound
@@ -605,45 +606,14 @@
setattr(misc_images, pid, MiscImage(pid, {}))
getattr(misc_images, pid)[name]=icon
-#
-# StructuredText handling.
-#
-# XXX: This section is mostly workarounds for things fixed in the
-# core, and should go away soon.
-#
-from StructuredText import Basic as STXBasic
-from StructuredText import DocumentWithImages
-from StructuredText.HTMLClass import HTMLClass
-from StructuredText.HTMLWithImages import HTMLWithImages
-
-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()
-
security.declarePublic('format_stx')
def format_stx( text, level=1 ):
+ """ Render STX to HTML.
"""
- Render STX to HTML.
- """
- st = STXBasic( text ) # Creates the basic DOM
- if not st: # If it's an empty object
- return "" # return now or have errors!
-
- doc = DocumentWithImages( st )
- html = CMFHtmlWithImages( doc, level )
- return html
-
-_format_stx = format_stx # XXX: Deprecated spelling
+ warn('format_stx() will be removed in CMF 1.6. Please use '
+ 'StructuredText.StructuredText.HTML instead.',
+ DeprecationWarning)
+ return HTML(text, level=level, header=0)
#
# Metadata Keyword splitter utilities
More information about the CMF-checkins
mailing list