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=`{``}`, layer=`'``Unknown``'`) runs code in environment and returns the output. | source code
snapshot(info=1, context=5, code=1, environment=1) 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=`{``}`, 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.