Alex Fernandez wrote:
A few things ;)  As Uwe has explained above, Windows integration with
the executable does not work well due to a bug in the shell, so when
LyX calls eLyXer on Windows as:
  > elyxer.py --directory "directory path" "input file.lyx" "output file.html"
eLyXer does not receive paths with spaces. Mind you, eLyXer standalone
works perfectly, and when invoked as follows:
  > python elyxer.py --directory "directory path" "input file.lyx"
"output file.html"
it also works. But for this Python needs to find the elyxer.py file.

Wouldn't it be better to solve this problem instead? I doubt it's a bug in the Windows shell.

When you open a file using the Windows shell, the shell identifies the application that is associated with the file extension and passes the filename as command line parameter to this application. The API that handles such a ShellExecute call in addition includes a parameter to pass as an extra command line parameter. The file association again specifies the position where this should be added on the command line. It's a different parameter and should not be added to the document filename. So if LyX only takes a single parameter, I don't think this method is going to work.

However, I also think it's not a good idea to use the file association in the registry for .py files. This is because the Windows installers includes a subset of python, which is what we use to for all scripts included with LyX. The python.exe of this bundled version is added to the LyX path, so when you call python.exe you'll automatically get this one. I would recommend you to also use the included python, because this way users won't need to install an external version as well. If some files required by your script are missing in the subset that is distributed with the installers, they can easily be added.

Joost

Reply via email to