On Fri, Dec 18, 2009 at 5:42 PM, Enrico Forestieri <for...@lyx.org> wrote: > Yep, as I said, in development/tools there is a shell script (lyxeditor) > that parses the preferences file and lyxrc.dist for the lyxpipe definition. > It works on Linux, MacOS, and Cygwin. It would be easy to extend it to > also work on native Windows, but then you would need a Bourne-like shell > to execute it. So, it would be better to convert it to Python. This should > be a rather simple task.
Okay, here's a very rough draft. This is the first thing I've written in Python, so some things are very ugly. It works for me under Win32, but I haven't tested under anything else. I wasn't able to find a native Python method which works with windows named pipes. So instead, I'm using handle = os.popen("echo " + COMMAND + "> " + LYXPIPE + ".in", 'r') I'm not proud of this, but I think there's nothing wrong. It almost works as you suggested: > > SumatraPDF $$i -inverse-search "/path/to/lyxeditor.py %f %l" but /path/to should be $$s/scripts. Unfortunately, $$s doesn't seem to work for viewers for some reason. Also, I need to python: "pythonw $$s/..." Pythonw has the advantage of not popping up a console. Also it's only 26kb, so hopefully I can convince Uwe to include it. One other thing that's on my mind: can we automatically fix the version_suffix upon make? There is this code lyxrc.dist.in:\serverpipe "~/....@version_suffix@/lyxpipe" which makes me think I can do version_suffix = "@version_suffix@" lyxeditor.py. Finally, can we change the name? Perhaps to gotorow.py? :) -Ben
lyxeditor.py
Description: Binary data