|
Configurator
|
Base class for tree displayable objects. More...
Public Member Functions | |
| def | __init__ |
| Node Constructor | |
| def | parent_index_find |
| Recursively find parent of self starting from root_node. | |
| def | show |
| Method print self indented by indent. | |
| def | sub_node_append |
| Append sub_node to the children sub nodes of self. | |
| def | xml_write |
| Method writes self to out_stream indented by indent. | |
Base class for tree displayable objects.
The Node class is a common base class used for sub-classes that need to be displayable in the GUI as a part of a tree widget.
| def data_structures.Node.__init__ | ( | self, | |
| class_name, | |||
| text, | |||
| icon_name, | |||
| sub_nodes, | |||
| style | |||
| ) |
Node Constructor
| self | Node object being initialized. |
| class_name | str The textual name of the sub-class. |
| text | str Text to show on tree widget |
| icon_name | str Name of the icon to show next to object (or None). |
| sub_nodes | list The list of sub-class object under this Node. |
| style | Style object used for formatting. |
This method initializes Node with the class_name (e.g. "Module_Use", "Selection", etc.), the icon name from the Icons directory, sub_nodes which is a list of Node object that constitute the children of self, and style which is a Style object that specifies the format of generated code.
| def data_structures.Node.parent_index_find | ( | self, | |
| root_node | |||
| ) |
| def data_structures.Node.show | ( | self, | |
| indent | |||
| ) |
Method print self indented by indent.
| self | Node object to write out. |
| indent | int that specifies how much to indent by. |
This provides a quick and dirty interface for debugging.
| def data_structures.Node.sub_node_append | ( | self, | |
| sub_node | |||
| ) |
| def data_structures.Node.xml_write | ( | self, | |
| indent, | |||
| out_stream | |||
| ) |
Method writes self to out_stream indented by indent.
| self | Node object to write out. |
| indent | int that specifies how much to indent by. |
| out_stream | File that specifies an output stream to write to. |
This method will write self in XML format to out_stream indented by indent. This method should be overridden to provide the correct tags and attributes .
1.8.2