This post will be of interest only to those with a deep interest in
Leo's implementation. Feel free to ignore.
Otoh, this post explains why progress on the grand refactoring now in
progress may be a bit "stately" :-)
Last night I wrote some notes to myself. They contain questions that
will require experimentation to resolve. The code is literally too
difficult to analyze directly. The essence of the situation is that
initing Leo's various classes is extremely complex, especially the
Commander, leoFrame and leoKeyHandler classes.
I may create a new guideline for all "complex" ctors: they should be
able to execute successfully regardless of whether other objects have
been completely inited. This is hardly a complete solution, but it may
be a step forward.
Anyway, here are my notes from last night. They should give you a
(partial) feel for the complexities that the LoadManager must handle:
QQQQQ
Reading any file (including settings files) will be done as follows:
1. Create a commander for the file.
**Important**: The gui is known, so we can create a frame.
However, we don't want to *draw* the frame without knowing all
settings.
To do: Can we create a frame without drawing it??
2. Physically read the .leo file using the sax parser.
To do: Can be done at all?? That is, can it be done using only
partially inited commander?
Experiment!
To do: Can this be done *without* knowing any settings??
It would seem essential, but I'm not entirely clear about this.
3. Handle the settings in the file.
A. Parse the @settings tree in the file.
B. Merge the settings with previous settings.
Note: this may set LoadManager ivars.
C. (New) create a *single* config dict, so that c.config.get is
very fast.
4. Enable plugins after *all* settings have been read?
To do: do we have to enable plugins all at once, or can we do that
for each file??
5. Draw the frame, thereby generating events to be handled by plugins.
QQQQQ
These notes are merely a starting point. Experimentation will likely
reveal further complexities and different strategies for getting .leo
files loaded in a single pass, without loading any file twice.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.