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

Class RawNode

source code

object --+
         |
        RawNode

Lightweight node for raw content and attribute assignment
Instance Methods
 
__init__(self, node)
Initialization
source code
 
__setitem__(self, name, value)
Set the attribute name to value
source code
str
__getitem__(self, name)
Determine the value of attribute name
source code
 
__delitem__(self, name)
Delete attribute name
source code

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

Properties
str content
Raw content
EncoderInterface encoder
Output encoder
DecoderInterface decoder
Input decoder

Inherited from object: __class__

Method Details

__init__(self, node)
(Constructor)

source code 
Initialization
Parameters:
  • node (Node) - The original node
Overrides: object.__init__

__setitem__(self, name, value)
(Index assignment operator)

source code 

Set the attribute name to value

The value is not encoded according to the model. The original case of name is preserved. If the attribute does not occur in the original template, the case of the passed name is taken over. Non-string values (including unicode, but not None) are converted to string using str().

Parameters:
  • name (str) - The attribute name (case insensitive)
  • value (str) - The attribute value (may be None for short attributes). Objects that are not None and and not unicode are stored as their string representation.

__getitem__(self, name)
(Indexing operator)

source code 
Determine the value of attribute name
Parameters:
  • name (str) - The attribute name
Returns: str
The attribute (None for shorttags)
Raises:
  • KeyError - The attribute does not exist

__delitem__(self, name)
(Index deletion operator)

source code 

Delete attribute name

If the attribute does not exist, no exception is raised.

Parameters:
  • name (str) - The name of the attribute to delete (case insensitive)

Property Details

content

Raw content
Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, content)
Type:
str

encoder

Output encoder
Get Method:
unreachable.fget(self)
Type:
EncoderInterface

decoder

Input decoder
Get Method:
unreachable.fget(self)
Type:
DecoderInterface