[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cmf
Subject:    [Zope-CMF] non string arguments to python scripts
From:       Lucas Hofman <lucas.hofman () pgs ! com>
Date:       2003-05-28 13:02:09
[Download RAW message or body]

The script below is called from a form. pictureFile is of type file. 
However, after passing the parameter to another python script 
(insert_picture) it has become a string (I concluded this because 
same_type(pictureFile, '') returns true. The value is the filename of 
the file object..

Is there a way to pass the pictureFile parameters so that it is not 
converted?


## Script (Python) "agenda_edit"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=title, choice, text, description, project, consortium, 
notOnMainPage, pictureId, pictureCaption, pictureFile
##title=
##
from string import strip
if strip(choice) == 'Insert Image':
     return context.insert_picture (text, pictureId, pictureCaption, 
pictureFile)


I feel that I am overlooking something...

-- 
Hilsen/Regards,

Lucas Hofman
PGS Research                                    work: +47 67514059
PO Box 354                                       fax: +47 67526640
N-1326 Lysaker, Norway                        mobile: +47 91601305
lucas.hofman@pgs.com                            http://www.pgs.com




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic