enaml.core.pattern
Classes
A declarative object that represents a pattern object. |
- class enaml.core.pattern.Pattern(parent=None, **kwargs)[source]
Bases:
Declarative
A declarative object that represents a pattern object.
The Pattern class serves as a base class for other classes such as Looper and Conditional, where the compiler nodes for the hierarchy are used to modify the standard behavior of creating children.
Creating a Pattern without a parent is a programming error.
- __intercepts_child_nodes__ = True
Single to the compiler that this class handles child creation.
- pattern_nodes
Storage for the collected pattern nodes. This is used directly by subclasses and should not be manipulated by user code.
- destroy()[source]
A reimplemented destructor.
The pattern will destroy all of the pattern items unless the parent object is in the process of being destroyed.
- child_node_intercept(nodes, key, f_locals)[source]
Add a child subtree to this pattern.
This method changes the default behavior of the runtime. It stores the child nodes and the locals mapping until the object is initialized, at which point the nodes will be called to create the pattern items.