[Zope] python script parameters

Dieter Maurer dieter@handshake.de
Tue, 13 Aug 2002 21:38:52 +0200


Ben Avery writes:
 > I'm having problems with passing a number of parameters to a python 
 > script called by XML-RPC.
 > I want some of the parameters to be optional, and passed as empty 
 > strings. I have tried to do this by setting default values as empty 
 > quoted strings. But playing around even with setting non-empty default 
 > values in a list of params doesn't seem to work.
 > 
 > e.g.
 > if I set the parameter list of the method as: a, b="aardvark"
 > and then test the script, if I leave b empty, the default aardvark is 
 > assumed.
 > 
 > but if I switch the order round, and set the param list as: b="aardvark", a
 > and do the same, the script breaks with the error 'the parameter b was 
 > ommited from request.
I am not sure but I fear XML-RPC can only handle positional arguments.


Dieter