On Wednesday, August 14, 2019 at 4:51:15 AM UTC-5, Edward K. Ream wrote: > the pyzo_in_leo plugin now loads *all* of pyzo's docks.
I have retired the pyzo_file_browser plugin. The pyzo_in_leo plugin now does everything that the pyzo_file_browser plugin did. As a result, there is no longer any need to share the start_pyzo_in_leo and load_all_docks functions. They are now defined in the pyzo_in_leo plugin. *Imports and monkey-patching* We seem to be going around and around with regard to monkey-patching the code, but at every iteration the code (and the ideas) become simpler. I now see that importing pyzo (pyzo.__init__.py) has *always* been "de-fanged". The rules: 1. *Never call pyzo.start.* 2. *Never import pyzo.__main__.py* (it calls pyzo.start) Instead of using pyzo.start, Leo calls *start_pyzo_in_leo*. This function contains init code from pyzo.start(), MainWindow.__init__ and MainWindow._populate. Monkey-patching code might still be problematic, because start_pyzo_in_leo instantiates many pyzo objects. For now (forever?) I'll patch the actual pyzo sources in place. *Summary* It's easy to de-fang pyzo imports. Don't call pyzo.start, and don't import pyzo.__main__.py. The start_pyzo_in_leo and load_all_docks functions have moved from pyzo.__init__.py to the pyzo_in_leo plugin. 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 view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/cb1bfa45-1224-44a4-96ca-d56e327eb89d%40googlegroups.com.
