On Thursday, November 23, 2017 at 1:27:38 AM UTC-6, Edward K. Ream wrote:
> *The Aha* > The @c.command decorator, defined in leoCommands.py, will define a > command, just like g.command. And (Aha!) the decorator will *also *inject > the function (as a method) into the Commands class. > It *might *be better to define new subcommanders to "hold" commander commands. For example, the CommanderFileCommands class would define a save method which the the @c.command decorator would inject into the Commands class. But what to do about existing assignments c = self in commander commands? Could they be translated *safely* to c = self.c? It's worrisome... So we have a dilemma. One the one hand, it's *always* better to use classes to encapsulate related functions. Otoh, it would be intolerable for text transformations to introduce subtle bugs in commander commands. Existing unit tests don't cover all the cases. I'll have to think about this... 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.
