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 <> | License: LGPLv3 (

Restricted environment to execute application's code -----------------------------------------------------

Classes [hide private]
Defines the ticket object and the default values of its members (None)
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=None, layer='Unknown')
Runs code in environment and returns the output.
source code
snapshot(info=None, context=5, code=None, environment=None)
Return a dict describing a given traceback (based on cgitb.text).
source code
Variables [hide private]
  logger = logging.getLogger("web2py")
  __package__ = 'gluon'
Function Details [hide private]

restricted(code, environment=None, 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.