Angus Leeming <[EMAIL PROTECTED]> writes: > > Ideally, we'd remove the hard-coding from the compiled source: > > $ grep -r '"sh ' src | grep -v ChangeLog | grep -v Makefile > src/lyx_main.C: "sh " + QuoteName(configure_script); > src/converter.C: "sh " + > src/lyx_cb.C: string const configure_command = "sh " + > QuoteName(configure_script); > src/frontends/controllers/tex_helpers.C: "sh " + > src/graphics/GraphicsConverter.C: "sh " + > src/graphics/GraphicsConverter.C: script_command_ = "sh " + > QuoteName(script_file_) + ' ' + > > > Anyway, it does not sound too difficult to replace this on-the-fly script > > with equivalent python code. > > Sure. It's not. It just needs time and energy. > > > I may come up with a patch to src/graphics/GraphicsConverter.C soon. > > Bo >
Bo's idea doesn't seem to me far-fetched. In fact, I compiled a lyx2lyx.exe with py2exe, distributed with Python 2.4.1, available at the wiki page; what you get is a directory containing a caller to yourapp.exe, the python.dll library, a zipped file with the byte-compiled files required for your script, and the unzipping library. It would be possible to make an .exe file for every python script, pack together all the required byte-compiled files into one big .zip, and distribute a single python.dll file. However, it seems to me that this may be done only for the lib/configure and the lib/scripts/*.sh scripts; the scripts generated on the fly by GraphicsConverter.C indeed may be trickier: if you can't make sure all scripts are called exactly the same---which makes the on-the-run generation pointless---, and they all need exactly the same .pyo files for processing, then you need the python.exe anyway. Thus, in practical terms, you either have to remove the dependency on those on-the-fly generated python scripts, or you need to make sure any of such lyx-generated python scripts require exactly the same byte-compiled python modules; in the latter case, you must include the python.exe in the distribution. I think the first strategy is the more general: if you need only one script (perhaps taking the filenames and extensions as arguments), it may be dealt with as the configure and the other shell scripts. (BTW, here you get more arguments to implement some built-in scripting language) Luis. P.S. I tried Lout once; not a chance against TeX. (No flame or BS.)