web2py.gluon.restricted

Package web2py :: Package gluon :: Module restricted |
[hide private]
[frames] | no frames]

# Module restricted

source code
This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)

Classes | [hide private]
| TicketStorage defines the ticket object and the default values of its members (None)
| RestrictedError class used to wrap an exception that occurs in the restricted environment below.

Functions | [hide private]
compile2(code, layer) The +' ' is necessary else compile fails when code ends in a comment. | source code
restricted(code, environment=global_settings.applications_parent, layer=`'``Unknown``'`) runs code in environment and returns the output. | source code
snapshot(info=global_settings.applications_parent, context=5, code=global_settings.applications_parent, environment=global_settings.applications_parent) Return a dict describing a given traceback (based on cgitb.text). | source code

Variables | [hide private]
| logger = `logging.getLogger("web2py")`

Function Details | [hide private]

### restricted(code, environment=global_settings.applications_parent, layer=`'``Unknown``'`) | source code
runs code in environment and returns the output. if an exception occurs in code it raises a RestrictedError containing the traceback. layer is passed to RestrictedError to identify where the error occurred.