Edward,
On Sun, Mar 15, 2020 at 11:38 AM Edward K. Ream <[email protected]> wrote:
> > the history of re-implementations contains a lot of sad failures. It's
> just too big a job, the new implementations have their own bugs, and by the
> time they get done, the original version has developed beyond that the new
> one has implemented.
>
> I have no intention of doing a grand reimplementation. However, many of
> Vitalije's suggestions have lead to real improvements.
>
I'll look at all specific suggestions.
>
What do you think about the following specific suggestion?
Change all 'g.app' references in the methods of the LeoApp class to 'self'.
Or add 'app = self' to the method and change 'g.app' to 'app'.
Example diffs for one method:
@@ -1444,57 +1450,61 @@ class LeoApp:
@cmd('quit-leo')
def onQuit(self, event=None):
"""Exit Leo, prompting to save unsaved outlines first."""
- if 'shutdown' in g.app.debug:
+ app = self
+ if 'shutdown' in app.debug:
g.trace()
- g.app.quitting = True
- if g.app.loaded_session and g.app.sessionManager:
- g.app.sessionManager.save_snapshot()
- while g.app.windowList:
- w = g.app.windowList[0]
- if not g.app.closeLeoWindow(w):
+ app.quitting = True
+ if app.loaded_session and app.sessionManager:
+ app.sessionManager.save_snapshot()
+ while app.windowList:
+ w = app.windowList[0]
+ if not app.closeLeoWindow(w):
break
- if g.app.windowList:
- g.app.quitting = False # If we get here the quit has been
disabled.
+ if app.windowList:
+ app.quitting = False # If we get here the quit has been
disabled.
Brian
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/CAO5X8Cwq-Lo6zsuQe8ggzdE0Ff6k9%2BBY9jekz3H4qAq7AqCqAQ%40mail.gmail.com.