Package tdi :: Module nodetree :: Class TemplateNode
[frames] | no frames]

Class TemplateNode

source code

object --+
         |
        TemplateNode
Known Subclasses:

Template node

This is kind of a proto node. During rendering each template node is turned into a user visible Node object, which implements the user interface. TemplateNode objects provide a tree building interface instead.

Instance Methods
 
__init__(self, tagname, attr, special, closed)
Initialization
source code
 
append_text(self, content)
Append a text node
source code
 
append_escape(self, escaped, content)
Append an escaped node
source code
TemplateNode
append_node(self, tagname, attr, special, closed)
Append processable node
source code

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

Class Variables
  ctx = None
hash(x)
Properties
str endtag
End tag of the node

Inherited from object: __class__

Method Details

__init__(self, tagname, attr, special, closed)
(Constructor)

source code 
Initialization
Parameters:
  • tagname (str) - The name of the accompanying tag
  • attr (iterable) - The attribute list (((name, value), ...))
  • special (dict) - Special node information
Overrides: object.__init__

append_text(self, content)

source code 
Append a text node
Parameters:
  • content (str) - The text node content
Raises:

append_escape(self, escaped, content)

source code 
Append an escaped node
Parameters:
  • escaped (str) - The escaped string (in unescaped form, i.e. the final result)
  • content (str) - The escape string (the whole sequence)
Raises:

append_node(self, tagname, attr, special, closed)

source code 
Append processable node
Parameters:
  • tagname (str) - The name of the accompanying tag
  • attr (iterable) - The attribute list (((name, value), ...))
  • special (dict) - Special attributes. If it's empty, something's wrong.
  • closed (bool) - Closed tag?
Returns: TemplateNode
new TemplateNode instance
Raises:
  • NodeTreeError - The tree was already finalized
  • AssertionError - nothing special

Class Variable Details

ctx

hash(x)

Value:
None

Property Details

endtag

End tag of the node
Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, data)
Type:
str