You mean that we cannot redirect stdout/err globally to a file?

Frankly I do not know. The only method i know to get stdin/out for a
no-console windows program is createConsole which will display the
ugly console even if we can later on hide or redirect stdin/out. The
only perfect way to avoid console is

1. modify lyxerr and redirect it to a file and make sure lyx does not
write to stdout. ( any write-to-cout operation may crash lyx now)

2. merge hidecmd.exe to lyx itself, and use it to call any external
script. Basically that means replacing all system(...) calls with
createProcess that starts a hidden cmd.exe.

If somebody can do 1, I can do 2. Actually, 1 itself makes sense.

BTW, would it be possible to modifiy configure.py to make a copy of
its output in a file named config.log? This would be handy to be able
to check later how detection went.

The following would work. Do you want such a patch?

Bo

class Tee:
   def __init__(self, *args):
       self.files = args

   def write(self, data):
       for f in self.files:
           result = f.write(data)
       return result

   def writelines(self, seq):
       for i in seq: self.write(i)

import sys
sys.stdout = Tee(sys.stdout, open("/tmp/stdout.log", "w"))

Reply via email to