I m trying to run Lyx 1.4.2 (grat program!) under os/2 (ported by Paul
Smedley)
I have two problems related to python:
1)Lyx seems unable to find python scripts: if I press "reconfigure", I
get "python: can't open file ''D:/lyx/share/lyx/configure.py'': [Errno
2] No such file or directory"
Of course configure.py *is* there, but with reversed slashes
'D:\lyx\share\lyx\configure.py' .... Should I change something in the
python or Lyx configuration to get it right?
2)If I try to run the script directly fom a command window:
D:\lyx\share\lyx>python configure.py
the script starts, but stops forever while "Checking whether TeX allows
spaces in file names... " :-(
Looking into the script I found the following offending routine:
============
def checkTeXAllowSpaces():
''' Let's check whether spaces are allowed in TeX file names '''
tex_allows_spaces = 'false'
if lyx_check_config:
print "Checking whether TeX allows spaces in file names... ",
writeToFile('a b.tex', r'\message{working^^J}' )
if os.name == 'nt':
latex_out = cmdOutput(LATEX + r""" "\nonstopmode\input{\"a b\"}" """)
else:
latex_out = cmdOutput(LATEX + r""" '\nonstopmode\input{"a b"}' """)
if 'working' in latex_out:
print 'yes'
tex_allows_spaces = 'true'
else:
print 'no'
tex_allows_spaces = 'false'
addToRC(r'\tex_allows_spaces ' + tex_allows_spaces)
removeFiles( [ 'a b.tex', 'a b.log', 'texput.log' ])
==================
I am puzzled by that line "if os.name == 'nt':"
obviously, my os.name is "os2". Maybe I need some os2 specific change
there? Or I could just change it with "if os.name == 'os2':"? (I did it
and it actually seems to work, but there is another bunch of "nt"
specific code in another script lyxpreview_tools.py :-(
I know very little latex and nothing about python (and I am somewhat
allergic to OO programming in general), so I have no idea of what the
rest of the script does. Could someone be so kind to translate it for
me? (I can read forth, rexx, basic, pascal, php and a little C...)
And maybe is that win-related code in lyxpreview_tools.py where slashes
for python scripts get reversed?
thanks,
Piersante