[Zope] how to decode base64 in DTML?

Paul Winkler pw_lists at slinkp.com
Thu May 4 17:05:38 EDT 2006


On Thu, May 04, 2006 at 10:22:25PM +0200, Jaroslav Lukesh wrote:
> > From: Andreas Jung [mailto:lists at zopyx.com]
> > > import cStringIO
> > > import mimetools
> > > import binascii
> > > binascii.a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')
> > >
> > > in commandline python works OK.
> > >
> > 
> > Move such code inside a PythonScript..such code does not belong into
> > DTML..
> > it just bad style.
> 
> I was try this PythonScript (parameter: xemail):
> 
> import cStringIO
> import mimetools
> from Products.PythonScripts.Utility import allow_module

I think you're confused about this...  allow_module has to be used
in filesystem Product code *so that* you can import other stuff
into Python Scripts.

You can't use allow_module *inside* a Python Script, that would
defeat the whole purpose :)

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list