On Fri, 24 Nov 2017 00:50:21 -0800 (PST)
"Edward K. Ream" <
edre...@gmail.com> wrote:
> Recent revs in the cmds branch have successfully migrated all of the
> edit commands to leo/commands/commanderEditCommands.py. I now have a
> much better idea of what is needed. Considerable "routine" code
> changes have been required, but unit tests have revealed all
> problems.
>
> Imo, this project is clearly going to succeed. Better, the work is
> worth doing for it's own sake. In all cases, the required changes
> improve the clarity and encapsulation of the code. A few more days
> may be needed, but this project now seems worth doing regardless of
> how long it takes.
Just want to check I understand this project.
Starting afresh, there'd be an outline class, Outline, commonly referred
to as 'o', with an ivar o.cmd, an instance of a Commands class,
defining commands that can be performed on an outline. That separation
doesn't exist, so the command definitions are being moved to a separate
file to reduce the size of the (current) Commands class. The Commands
class becomes more of an Outline class, but will still be called
Commands / c for everyones sanity (although I think there's the odd
place where c is described as a "context").
Am I even close? If I am, would a different approach (not that we
can't use the injection approach already taken), would be to move all
the implementations to a new OutlineCommands class, and then just point
to those from Commands, for backwards compatibility. so Commands.save()
becomes
@cmd('save-file')
def save(self, event=None, fileName=None):
self.outline_commands.save(self, event=None, fileName=None)
or perhaps even
save = some_function_that_acheives_the_above()
only because we need the backwards compatibility.
Just making sure I understand this very large change.
Cheers -Terry