Would exec_environment() be useful here: http://web2py.com/book/default/chapter/04#Execution-Environment
On Wednesday, January 19, 2011 11:47:26 AM UTC-5, rochacbruno wrote: > 2011/1/19 Massimo Di Pierro <[email protected]> > >> No. You can only access the models. > > > I wonder if it is possible to start web2py in Shell mode, execute a > controller under the web2py environment. > inspect the controllers 'return' or use template.py to evaluate a view file > passing the controller return as argument. > > is there something like that? > > <dummy example> > $python web2py.py -S myapp -M -P > >>> db.tables > ['mytable'] > >>> my_return = execfile(/controllers/controller.py) > >>> print my_return['someobject'] > >>> from gluon.template import * > >>> print template.parse('/views/controller.html',response._vars=my_return) > '<html>.........................</html> > > </dummy example> > > I guess I saw something like this in web2py_test_runner. > > If something like that could be possible, this will be easy to UnitTest > web2py controllers and views. >

