On Feb 17, 7:23 am, "Edward K. Ream" <[email protected]> wrote:
> > The simple rule for each ctor then becomes: > > Each ctor creates all the objects it needs. The original beautiful plan to read each local .leo file once has fallen prey to an ugly fact :-) Indeed, it doesn't seem possible to call event handlers like open0, open1 and open2 without having inited settings. As a result, the 5-Phase load process in g.openWithFileName is dead. I won't morn it's loss. Today's work has been valuable. I've refactored the code in ways that will survive the failure of the first plan. The second plan will simplify code using another strategy, as follows:: 1. Leo will, as at present, read local files twice. The first load will discover the settings to be used in the second load. This will ensure that proper settings are *available* during the second load. 2. Instead of initing settings "late" in the finishCreate methods, all ctors will init settings "early", before calling the ctors for subsidiary objects. This will ensure that proper settings are *in effect* for the subsidiary ctors. 3. There is a clever way of using the fact that c.__init__ creates *all* subsidiary objects (directly or indirectly). After creating all such objects, c.__init__ can simply call c.finishCreate! It's beautiful, and it should work. "Internalizing" the call to c.finishCreate will help eliminate newLeoCommanderAndFrame, something that I very much want to do. At least one difficult puzzle remains, namely how to communicate the settings discovered in the first load to the c.config object created in the second load. Trust me, this is much harder than you might expect. But such problems *can* be solved cleanly. It just takes lots of work. I'll commit today's work soon, after more testing. This will be a fallback point should things break badly. Today's work should be safe enough because it is, in essence, equivalent to the previous rev when all the global switches are False. I'd like to get the new plan working tomorrow. We shall see. 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.
