On Tue, May 1, 2018 at 4:41 PM, vitalije <[email protected]> wrote:
> >> File "c:\leo.repo\leo-editor\leo\commands\editFileCommands.py", line >> 580, in compute_dicts >> assert v1.context != v2.context >> >> AssertionError >> >> >> Edward >> > > I plan to use something similar to NodeIndices for assigning unique string > keys to every created Commander instance. That way it would not matter if > two commander instances are opened with the same file, or if a user > executes saveAs and fileName get changed. Using fileName() was my first > guess, but it would be much better to have stable and unique key for > commanders. > Well, that's why *existing* context arg is a commander! I am dubious about this whole approach, for the following reasons: 1. The proposed new code increases the complexity of the VNode class. Imo, the VNode class should not know *anything* about how other classes use gnx's. Only the FileCommands class should handle the gnx computation. Imo, the changes are architecturally wrong. The proposed new code is likely to increase the hidden connection between the VNode and Commands classes. This is a big step backwards. The VNode class should not be dragged into the task of simplifying gnx computations. The present gnx computations, while not pretty, do not remotely justify complicating the VNode class. 2. I still do not understand why passing a "context" arg complicates using Vnodes. All classes have a self.c arg. But let's suppose that instantiating a "dummy" commander was odious in some situation. In that case, the obvious thing to do would be to define a minimal DummyCommands class. The g.NullObject class might even suffice. If not, it would be straightforward to define DummyCommands so it provides just those features needed to keep the VNode class happy. For me, architecture comes first. Imo, simplifying code at the expense of adding hidden dependencies between classes is a no no. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
