Package tdi :: Package integration :: Module wtf_service :: Class GlobalTemplate
[frames] | no frames]

Class GlobalTemplate

source code

object --+
         |
        GlobalTemplate

Actual global template service object
Instance Methods
 
__init__(self, locations, autoreload=False, filters=None)
Initialization
source code
wtf.app.services.resources.ResourceStream
stream(self, name, mode='rb', buffering=-1, blockiter=0)
Locate file in the template directories and open a stream
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, locations, autoreload=False, filters=None)
(Constructor)

source code 
Initialization
Parameters:
  • locations (iterable) - Resource locations (['token', ...])
  • autoreload (bool) - Automatically reload templates?
  • filters (dict) - Filter factories to apply
Overrides: object.__init__

stream(self, name, mode='rb', buffering=-1, blockiter=0)

source code 
Locate file in the template directories and open a stream
Parameters:
  • name (str) - The relative filename
  • mode (str) - The opening mode
  • buffering (int) - buffering spec
  • blockiter (int) - Iterator mode (1: Line, <= 0: Default chunk size, > 1: This chunk size)
Returns: wtf.app.services.resources.ResourceStream
The resource stream
Raises:
  • IOError - File not found