Package genshi :: Package template :: Module base :: Class DirectiveFactory

Class DirectiveFactory

object --+
         |
        DirectiveFactory
Known Subclasses:

Base for classes that provide a set of template directives.

Since: version 0.6

Nested Classes
  __metaclass__
Meta class for directive factories.
Instance Methods
 
get_directive(self, name)
Return the directive class for the given name.
 
get_directive_index(self, dir_cls)
Return a key for the given directive class that should be used to sort it among other directives on the same SUB event.

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

Class Variables
  directives = []
A list of (name, cls) tuples that define the set of directives provided by this factory.
Properties

Inherited from object: __class__

Method Details

get_directive(self, name)

 
Return the directive class for the given name.
Parameters:
  • name - the directive name as used in the template
Returns:
the directive class

See Also: Directive

get_directive_index(self, dir_cls)

 

Return a key for the given directive class that should be used to sort it among other directives on the same SUB event.

The default implementation simply returns the index of the directive in the directives list.

Parameters:
  • dir_cls - the directive class
Returns:
the sort key