Classes
LiveEditorModel | A model which works in concert with the live editor panels. |
Bases: atom.atom.Atom
A model which works in concert with the live editor panels.
This model manages the compiling and instantiation of the model and view objects defined by the user.
The model has six inputs:
- ‘model_text’
- The full text of the Python module which defines the model.
- ‘view_text’
- The full text of the Enaml module which defines the view.
- ‘model_item’
- The name of the target model class in the model module.
- ‘view_item’
- The name of the target enamldef in the view module.
- ‘model_filename’
- An optional filename to associate with the model module.
- ‘view_filename’
- An optional filename to associate with the view module.
The model has three outputs:
- ‘compiled_model’
- The instance of the user defined model, or None if no model could be created.
- ‘compiled_view’
- The instance of the user defined view, or None if no view could be created.
- ‘traceback’
- A string holding the traceback for any compilation and instantiation errors.
If the ‘compiled_view’ object has a ‘model’ attribute, then the ‘compiled_model’ object will be assigned to that attribute.
The current live model object bound to the main view.
The current live view object to include in the main view.
The Python module input text for the model module.
The Enaml module input text for the view module.
The string name of the Atom class to use as the model.
The string name of the enamldef to use as the view.
An optional filename to use when compiling the python code.
An optional filename to use when compiling the enaml code.
A string which holds the most recent tracekback.
Refresh the compiled model object.
This method will (re)compile the model for the given model text and update the ‘compiled_model’ attribute. If a compiled view is available and has a member named ‘model’, the model will be applied to the view.