OpenQuizz
Une application de gestion des contenus pédagogiques
ImmutableSandboxedEnvironment Class Reference
Inheritance diagram for ImmutableSandboxedEnvironment:
Collaboration diagram for ImmutableSandboxedEnvironment:

Public Member Functions

def is_safe_attribute (self, obj, attr, value)
 
- Public Member Functions inherited from SandboxedEnvironment
def intercept_unop (self, operator)
 
def __init__ (self, *args, **kwargs)
 
def is_safe_callable (self, obj)
 
def call_binop (self, context, operator, left, right)
 
def call_unop (self, context, operator, arg)
 
def getitem (self, obj, argument)
 
def getattr (self, obj, attribute)
 
def unsafe_undefined (self, obj, attribute)
 
def format_string (self, s, args, kwargs, format_func=None)
 
def call (__self, __context, __obj, *args, **kwargs)
 
- Public Member Functions inherited from Environment
def __init__ (self, block_start_string=BLOCK_START_STRING, block_end_string=BLOCK_END_STRING, variable_start_string=VARIABLE_START_STRING, variable_end_string=VARIABLE_END_STRING, comment_start_string=COMMENT_START_STRING, comment_end_string=COMMENT_END_STRING, line_statement_prefix=LINE_STATEMENT_PREFIX, line_comment_prefix=LINE_COMMENT_PREFIX, trim_blocks=TRIM_BLOCKS, lstrip_blocks=LSTRIP_BLOCKS, newline_sequence=NEWLINE_SEQUENCE, keep_trailing_newline=KEEP_TRAILING_NEWLINE, extensions=(), optimized=True, undefined=Undefined, finalize=None, autoescape=False, loader=None, cache_size=400, auto_reload=True, bytecode_cache=None, enable_async=False)
 
def add_extension (self, extension)
 
def extend (self, **attributes)
 
def overlay (self, block_start_string=missing, block_end_string=missing, variable_start_string=missing, variable_end_string=missing, comment_start_string=missing, comment_end_string=missing, line_statement_prefix=missing, line_comment_prefix=missing, trim_blocks=missing, lstrip_blocks=missing, extensions=missing, optimized=missing, undefined=missing, finalize=missing, autoescape=missing, loader=missing, cache_size=missing, auto_reload=missing, bytecode_cache=missing)
 
def iter_extensions (self)
 
def call_filter (self, name, value, args=None, kwargs=None, context=None, eval_ctx=None)
 
def call_test (self, name, value, args=None, kwargs=None)
 
def parse (self, source, name=None, filename=None)
 
def lex (self, source, name=None, filename=None)
 
def preprocess (self, source, name=None, filename=None)
 
def compile (self, source, name=None, filename=None, raw=False, defer_init=False)
 
def compile_expression (self, source, undefined_to_none=True)
 
def compile_templates (self, target, extensions=None, filter_func=None, zip="deflated", log_function=None, ignore_errors=True, py_compile=False)
 
def list_templates (self, extensions=None, filter_func=None)
 
def handle_exception (self, source=None)
 
def join_path (self, template, parent)
 
def get_template (self, name, parent=None, globals=None)
 
def select_template (self, names, parent=None, globals=None)
 
def get_or_select_template (self, template_name_or_list, parent=None, globals=None)
 
def from_string (self, source, globals=None, template_class=None)
 
def make_globals (self, d)
 

Additional Inherited Members

- Data Fields inherited from SandboxedEnvironment
 binop_table
 
 unop_table
 
- Data Fields inherited from Environment
 block_start_string
 
 block_end_string
 
 variable_start_string
 
 variable_end_string
 
 comment_start_string
 
 comment_end_string
 
 line_statement_prefix
 
 line_comment_prefix
 
 trim_blocks
 
 lstrip_blocks
 
 newline_sequence
 
 keep_trailing_newline
 
 undefined
 
 optimized
 
 finalize
 
 autoescape
 
 filters
 
 tests
 
 globals
 
 loader
 
 cache
 
 bytecode_cache
 
 auto_reload
 
 policies
 
 extensions
 
 enable_async
 
 is_async
 
- Static Public Attributes inherited from SandboxedEnvironment
 sandboxed
 
 default_binop_table
 
 default_unop_table
 
 intercepted_binops
 
 intercepted_unops
 
- Static Public Attributes inherited from Environment
 sandboxed
 
 overlayed
 
 linked_to
 
 shared
 
 code_generator_class
 
 context_class
 
- Properties inherited from Environment
 lexer = property(get_lexer, doc="The lexer for this environment.")
 

Detailed Description

Works exactly like the regular `SandboxedEnvironment` but does not
permit modifications on the builtin mutable objects `list`, `set`, and
`dict` by using the :func:`modifies_known_mutable` function.

Member Function Documentation

◆ is_safe_attribute()

def is_safe_attribute (   self,
  obj,
  attr,
  value 
)
The sandboxed environment will call this method to check if the
attribute of an object is safe to access.  Per default all attributes
starting with an underscore are considered private as well as the
special attributes of internal python objects as returned by the
:func:`is_internal_attribute` function.

Reimplemented from SandboxedEnvironment.


The documentation for this class was generated from the following file: