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

Public Member Functions

def __init__ (self, path)
 
def load (self, environment, name, globals=None)
 
- Public Member Functions inherited from BaseLoader
def get_source (self, environment, template)
 
def list_templates (self)
 

Static Public Member Functions

def get_template_key (name)
 
def get_module_filename (name)
 

Data Fields

 module
 
 package_name
 

Static Public Attributes

 has_source_access
 
- Static Public Attributes inherited from BaseLoader
 has_source_access
 

Detailed Description

This loader loads templates from precompiled templates.

Example usage:

>>> loader = ChoiceLoader([
...     ModuleLoader('/path/to/compiled/templates'),
...     FileSystemLoader('/path/to/templates')
... ])

Templates can be precompiled with :meth:`Environment.compile_templates`.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  path 
)

Member Function Documentation

◆ get_module_filename()

def get_module_filename (   name)
static

◆ get_template_key()

def get_template_key (   name)
static

◆ load()

def load (   self,
  environment,
  name,
  globals = None 
)
Loads a template.  This method looks up the template in the cache
or loads one by calling :meth:`get_source`.  Subclasses should not
override this method as loaders working on collections of other
loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)
will not call this method but `get_source` directly.

Reimplemented from BaseLoader.

Field Documentation

◆ has_source_access

has_source_access
static

◆ module

module

◆ package_name

package_name

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