On Thu, Sep 9, 2010 at 8:55 PM, Edward K. Ream <edream...@gmail.com> wrote:
> On Thu, Sep 9, 2010 at 12:09 PM, Ville M. Vainio <vivai...@gmail.com> wrote: > >> What's your reason for dealing with all this complex stuff? What kind >> of integration are you trying to accomplish? > > The complexity behinds the scenes makes things a lot simpler for the > user. It makes the following @button script work in LeoDocs.leo, > whether or not screenshots.py has been enabled previously: > > @button take-screenshot > > g.loadOnePlugin(c,'screenshots') > c.k.simulateCommand(take-screen-shot') So you are basically saying that loadOnePlugin was broken previously? > > The following would also work: > > g.loadOnePlugin(c,'screenshots') > c.screenshotController.take_screen_shot() > > Just as importantly, the details make the following unit test work > properly when run externally from leoPlugins.leo, even if > screenshot.py is not enabled. > > QQQQQ > @test take-screen-shot > > # Works in external unit tests. > g.loadOnePlugin(c,'screenshots') > sc = c.screenshotController > assert sc > > # Select the screenshot node. > h = '@slideshow ../test/screenshot-unit-test.html' > p2 = g.findNodeAnywhere(c,h) > c.selectPosition(p2.firstChild()) > > sc.take_screen_shot() > QQQQQ > > To make this work, the @slideshow tree must be a descendant of a > mark-for-unit-tests node. The Alt-5 or Alt-6 copies the marked tree > to external .leo file. > > Running unit test externally is mandatory for test-driven development: > the tests use the latest (saved) code, so the tests can be run > directly from leoPlugins.leo. > > I'm doing that now. The remaining issues involve gritty details like > whether filenames should be relative, and if so, relative to what. > > Edward > > -- > You received this message because you are subscribed to the Google Groups > "leo-editor" group. > To post to this group, send email to leo-edi...@googlegroups.com. > To unsubscribe from this group, send email to > leo-editor+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/leo-editor?hl=en. > > -- Ville M. Vainio @@ Forum Nokia -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to leo-edi...@googlegroups.com. To unsubscribe from this group, send email to leo-editor+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.