Following up on this previous topic... thanks to those who responded.
It was very unfortunate that rexec is now considered unsafe, but I think I'll
proceed using it, in addition to some other security mechanisms.
Now, my question is about namespaces. In a nutshell, from an XMLRPC servlet
method, I want to be able to 'exec' a (quasi-arbitrary) Python statement that
creates/assigns a new variable. Then at a later time I want to be able to
refer to that variable. So, I guess, essentially I want to update the
I was beginning to play with this TimeServlet:
from WebKit.XMLRPCServlet import XMLRPCServlet
#from time import *
rex = rexec.RExec()
rex.ok_builtin_modules = ('errno', 'marshal', '_sre', 'time')
rex.r_exec('from time import *')
return ['execCmd', 'getVar']
def execCmd(self,sarg): # e.g., rpc.execCmd('mytime = str(time())')
def getVar(self,sarg): # return the value of some variable, e.g, 'mytime'