Thanks Terry! I used the os.environ() and sys.path() to ensure that the command-line and browser situations have exactly the same paths. In both situations, I am invoking the same script in the same cgi-bin directory.
However, controller.isOpen() still returns False. Let me know if you found that note. In the meantime, I'll continue to puzzle over this problem. -Scott On Monday, February 9, 2015 at 2:50:31 AM UTC-5, Terry Brown wrote: > > Hi stl, > > I don't have an appropriate machine for checking just now, but I think I > wrote a note somewhere about running leobridge and some tricks to do with > the environment. I would try having your script display/print os.environ > and sys.path and check for differences between the command line and browser > situations. That might not be exactly the right place to look, I'll see if > I can find the note. Check the current directory in the two situations too. > Cheers -Terry > > On February 9, 2015 8:20:37 AM NZDT, stl <[email protected] <javascript:>> > wrote: >> >> Hi Terry, >> >> I am relatively new to Leo. And your post is most relevant to what I am >> trying to do. >> >> I am trying to use leoBridge within a python cgi script. I am using >> apache2. The leoBridge code was excerpted from the Leo5.0 documentation. >> >> For some reason, leoBridge.controller remains closed when I invoke the >> script from the browser. In other words, controller.isOpen() always >> returns False. (Consequently, I get attributeError due to NoneType when >> the script tries to access functions in controller.) >> >> I run the same script via cmd-prompt and everything seems to work (e.g., >> traversing various nodes). >> >> Am I missing something obvious? >> >> Your approach with leoweb.py seems to suggest that leoBridge cannot be >> embedded within a cgi script. >> >> Thanks! >> stl >> >> >> On Wednesday, June 19, 2013 at 1:35:59 PM UTC-4, Terry Brown wrote: >>> >>> For the next 2.25 weeks I'm going to be traveling, Reykavik and St. >>> Petersburg (Russia, not Florida :-). So there may not be much more to >>> report for a while, but I've started what looks like a promising >>> attempt at a web interface to Leo. Very much based on a path of least >>> resistance for my skill set. >>> >>> So far you can drag nodes around the tree, cut and paste and insert >>> them, and edit the headline text. And tell the server to save the >>> outline. The architecture is: >>> >>> Python's BaseHTTPServer running the 'server'. >>> New code ('leoweb.py') communicating with the browser. >>> jQuery and jQuery-UI handling the interface (authored in coffeescript). >>> And the critical link - leoBridge as the backend for leoweb.py. >>> >>> So in an odd way this is a database driven Leo, using Leo as the >>> backend database :-) I'm trying to minimize the dependencies, >>> currently they're essentially zero, seeing jQuery and jQuery-UI are >>> publicly hosted. >>> >>> Still some work on the core to do, i.e. handling expansion / >>> contraction properly. Then body text editing, which should be >>> reasonably straight forward. Then... and this is where this can become >>> so much more than just another on line outliner, minibuffer commands. >>> Which of course is a huge security issue, but never mind that for now. >>> >>> Because of the path of least resistance requirement I'm not trying to >>> implement a Leo UI, i.e. another version of Leo's UI code of which >>> there is currently the nullGui and Qt versions, and used to be the Tk >>> version. This might evolve in that direction, or not, I'm not sure. >>> The event loop is in the user's browser in javascript and not on >>> the server in python. But it would be a shame not to be able to do >>> some of the things that require knowledge of body editor cursor position >>> and selected text, for example, so we'll see what happens. >>> >>> So currently it's essentially a new, coffee/javascript based editor of >>> Leo outlines with the power of leoBridge to call on. >>> >>> Cheers -Terry >>> >>> >>> -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
