[Zope-CMF] STX in python script

David Brown david.d.brown@wamu.net
Wed, 01 Aug 2001 15:29:01 -0700


This is something that should be submitted to ZopeLabs
(http://www.zopelabs.com).

It's certainly a useful bit of information to know.

Steve Spicklemire wrote:
> 
> Hmm.. you can't do:
> 
> from Products.PythonScripts.standard import special_formats
> 
> return special_formats['structured-text']('*hi* there')
> 
> ???
> 
> -steve
> 
> On Tuesday, July 31, 2001, at 09:27 PM, Tres Seaver wrote:
> 
> > Adrian Madrid wrote:
> >
> >> I need to transform a long bunch of articles (custom
> >> type) from structured text to their rendered html. I
> >> have created a python script to go through the
> >> collection of articles and transport the original STX
> >> from one field to another as HTML and but my problem
> >> is how to render the STX. How do you render STX in a
> >> python script?
> >> Thanks in advance,
> >
> >
> > At the moment, you will need either to do this as an ExternalMethod,
> > or else add an alias and some module security declarations to
> > CMFCore.utils.py;  the issue is that the method, '_format_stx',
> > can't be called from TTW code unless it a) loses the leading underscore,
> > and b) gets "tagged" as safe for TTW code.
> >
> > An ExternalMethod might look like:
> >
> >   from Products.CMFCore.utils import _format_stx
> >
> >   def format_stx( text, level=1 ):
> >       return _format_stx( text, level )
> >
> > Tres.
> > -- ===============================================================
> > Tres Seaver                                tseaver@zope.com
> > Zope Corporation      "Zope Dealers"       http://www.zope.com
> >
> >
> > _______________________________________________
> > Zope-CMF maillist  -  Zope-CMF@zope.org
> > http://lists.zope.org/mailman/listinfo/zope-cmf
> >
> > See http://www.zope.org/Products/PTK/Tracker for bug reports and
> > feature requests
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
> 
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests