Re: My traitsUI tutorial is finally out
rharder@... wrote:
> I'd have to say that my "problem", for lack of a better word, with ETS
> is that I look at the examples and I just don't understand what all of
> the bits are for.
I certainly wish we had more time to document all the ETS packages,
particularly Envisage, much better! We know this is a problem for
community uptake of the technologies and are trying to make time to
improve / develop this documentation, it is just slow going giving the
necessity of satisfying paying customers so that we can continue to
exist. That said, if you continue to e-mail this list with questions
you have, or point out areas where the docs are lacking, we can probably
provide much more timely information to you and help you ramp up on the
tools.
> # The plugin definitions required by the application.
> PLUGIN_DEFINITIONS = [
> # Envisage plugins.
> join(envisage_path, 'core/core_plugin_definition.py'),
> join(envisage_path, 'action/action_plugin_definition.py'),
> join(envisage_path, 'resource/resource_plugin_definition.py'),
> join(envisage_path, 'workbench/workbench_plugin_definition.py'),
> join(envisage_path, 'workbench/action/action_plugin_definition.py'),
> join(enthought_plugins_path, 'python_shell
> python_shell_plugin_definition.py'),
> join(enthought_plugins_path,
> 'text_editor/text_editor_plugin_definition.py'),
>
> # Application plugins.
> join('app_plugin_definition.py'),
> ]
>
> What is all this stuff? How would I know, starting from scratch with
> an empty editor, that this needs to be here? I wasn't even able to
> find documention for the join command!
>
I believe the Envisage section of the Enthought wiki does indicate that
you must provide a listing of the plugins that you want your application
to be composed of, and does say that each item in the list should be the
absolute path to the plugin_definition.py file.
The join command is just a convenience to do that and it was imported
from a specific package/module, so you could always look up what it does
there, right? You can always browse the source online through our Trac
instance if you don't want to expand the eggs, etc.
If the question is what are each of these plugins and why do you need
them, the answer is that they aren't really 'necessary' to build an
Envisage app. They are only needed if you want to use the capabilities
in each of these plugins. A delicate line, yes, but a critical one!
Envisage itself is just a small tool that manages plugins and provides
mechanisms for them to communicate with each other. It does not enforce
any look, feel, or behavior on your application at all since all of that
comes from plugins that make up your application, including the GUI
itself! Therefore, these plugins in Prabhu's example app are totally
optional from the Envisage point-of-view!
Now, specifically, each of those plugins does roughly the following.
You should be able to figure out more by reading the
plugin_definition.py files themselves.
core: Additional utilities and concepts for building
plugin-applications but not required for an Envisage app.
action: A mechanism for declaring user actions and grouping them
into menus and toolbars.
resource: A method of associating meta info (persistence, look and
feel, etc.) with specific data types.
workbench: An "IDE like" GUI provider.
workbench action: Allows extension of the menubar and toolbar within
the workbench GUI.
python shell: An interactive console to the Python interpreter
within the workbench GUI.
text editor: Menu items to load, edit, and save text files within
the workbench GUI. If the file is a Python script, it can also be run
and interact with the Python interpreter.
app plugin: The plugin providing the new behavior of Prabhu's
example application that is not listed in these other plugins.
Enthought has generated many, many, many plugins for Envisage
applications and the set above is only a small portion of those, though
it is probably the most commonly used subset.
Hope this helps somewhat!
-- Dave