[Zope-CMF] STX in python script

Adrian Madrid aem@byu.edu
Wed, 1 Aug 2001 15:21:06 -0700 (PDT)


Thanks for your help, it worked as a charm! I was
looking into the code of document and srtructured text
but running into permission problems. I haven't done a
 external method yet so I was a little afraid of that
but this script certainly saved my life.

Thanks again,

--- Steve Spicklemire <steve@spvi.com> 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.
> > --


=====
---------------------------
Adrian Esteban Madrid
Benson Institute, Webmaster
Brigham Young University
---------------------------
adrian_esteban@madrid.com
===========================

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/