Package tdi :: Module template :: Class AutoUpdate
[frames] | no frames]

Class AutoUpdate

source code

object --+
         |
        AutoUpdate

Autoupdate wrapper
Instance Methods
 
__init__(self, template, _cb=None)
Initialization
source code
any
__getattr__(self, name)
Pass through every request to the original template
source code
AutoUpdate
autoupdate_factory(self, new)
Create new autoupdate wrapper from instance.
source code
 
autoupdate_register_callback(self, callback)
Register an autoupdate callback function
source code
Template
overlay(self, other)
Overlay this template with another one
source code
 
template(self)
Return a clean template (without any wrapper)
source code
bool
update_available(self)
Check for update
source code
Template
reload(self, force=False)
Reload template(s) if possible and needed
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, template, _cb=None)
(Constructor)

source code 
Initialization
Parameters:
  • template (Template) - The template to autoupdate
Overrides: object.__init__

__getattr__(self, name)
(Qualification operator)

source code 

Pass through every request to the original template

The template is checked before and possibly replaced if it changed.

Parameters:
  • name (str) - Name to lookup
Returns: any
The requested value
Raises:
  • AttributeError - not found

autoupdate_factory(self, new)

source code 

Create new autoupdate wrapper from instance.

This is needed, when adding template wrappers.

Parameters:
  • new (any) - Template object
Returns: AutoUpdate
Autoupdated-wrapped template

autoupdate_register_callback(self, callback)

source code 

Register an autoupdate callback function

The function will be called, every time a template is reloaded automatically. The template is passed as only argument to the callback function.

Parameters:
  • callback (callable) - The callback function.

overlay(self, other)

source code 
Overlay this template with another one
Parameters:
  • other (Template) - The template layed over self
Returns: Template
The combined template

template(self)

source code 
Return a clean template (without any wrapper)

update_available(self)

source code 
Check for update
Returns: bool
Update available?

reload(self, force=False)

source code 
Reload template(s) if possible and needed
Parameters:
  • force (bool) - Force reload (if possible)?
Returns: Template
The reloaded (new) template or self