Package mdp :: Package hinet :: Class HiNetHTMLTranslator
[hide private]
[frames] | no frames]

Class HiNetHTMLTranslator


Specialized translator for HTML.

Instead of relying on the return values the HTML lines are directly
written to a provided file.

Instance Methods [hide private]
 
__init__(self, show_size=False)
Initialize the HMTL translator.
 
_close_node_env(self, node, type_id='node')
Close the HTML environment for the node internals.
 
_open_node_env(self, node, type_id='node')
Open the HTML environment for the node internals.
 
_translate_clonelayer(self, layer)
Translate a CloneLayer and return the translation.
 
_translate_flow(self, flow)
Translate the flow into HTML and write it into the internal file.
 
_translate_flownode(self, flownode)
Translate a node containing a flow and return the translation.
 
_translate_layer(self, layer)
Translate a layer and return the translation.
 
_translate_sameinputlayer(self, layer)
Translate a SameInputLayer and return the translation.
 
_translate_standard_node(self, node)
Translate a node and return the translation.
 
_write_node_header(self, node, type_id='node')
Write the header content for the node into the HTML file.
 
write_flow_to_file(self, flow, html_file)
Write the HTML translation of the flow into the provided file.

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

    Inherited from HiNetTranslator
 
_translate_node(self, node)
Translate a node and return the translation.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, show_size=False)
(Constructor)

 
Initialize the HMTL translator.

show_size -- Show the approximate memory footprint of all nodes.

Overrides: object.__init__

_close_node_env(self, node, type_id='node')

 
Close the HTML environment for the node internals.

node -- The node itself.
type_id -- The id string as used in the CSS.

_open_node_env(self, node, type_id='node')

 
Open the HTML environment for the node internals.

node -- The node itself.
type_id -- The id string as used in the CSS.

_translate_clonelayer(self, layer)

 
Translate a CloneLayer and return the translation.

Overrides: HiNetTranslator._translate_clonelayer
(inherited documentation)

_translate_flow(self, flow)

 
Translate the flow into HTML and write it into the internal file.

Use write_flow_to_file instead of calling this method.

Overrides: HiNetTranslator._translate_flow

_translate_flownode(self, flownode)

 
Translate a node containing a flow and return the translation.

The internal nodes are translated recursively.

Note that this method is used for translation whenever the node has
a flow attribute. This flow attribute is then used for the iteration,
so the node itself does not have to be an iterable.

Overrides: HiNetTranslator._translate_flownode
(inherited documentation)

_translate_layer(self, layer)

 
Translate a layer and return the translation.

All the nodes in the layer are translated.

Overrides: HiNetTranslator._translate_layer
(inherited documentation)

_translate_sameinputlayer(self, layer)

 
Translate a SameInputLayer and return the translation.

Overrides: HiNetTranslator._translate_sameinputlayer
(inherited documentation)

_translate_standard_node(self, node)

 
Translate a node and return the translation.

This method is used when no specialized translation (like for FlowNodes
or Layers) is required.

Overrides: HiNetTranslator._translate_standard_node
(inherited documentation)

_write_node_header(self, node, type_id='node')

 
Write the header content for the node into the HTML file.

write_flow_to_file(self, flow, html_file)

 
Write the HTML translation of the flow into the provided file.

Note that html_file file can be any file-like object with a write
method.