keytest.py: Allow for LyX window to appear without timeout

Timeout for lyx-process to appear may be significantly smaler.
5 sec. looks sufficient, while lyx-window may take some time
due to configure.py.
This commit is contained in:
Kornel Benko 2014-08-25 14:28:18 +02:00
parent 80aafdb5eb
commit 6767052bba

View File

@ -342,17 +342,18 @@ while not failed:
intr_system(lyx_exe + c[9:] + "&")
else:
intr_system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&")
count = 100
count = 5
while count > 0:
lyx_pid=os.popen("pidof " + lyx).read().rstrip()
if lyx_pid != "":
lyx_window_name=os.popen("wmctrl -l -p | grep ' " + str(lyx_pid) + " ' | cut -d ' ' -f 1").read().rstrip()
if lyx_window_name != "":
break
else:
count = count - 1
print 'lyx_win: ' + lyx_window_name + '\n'
print "Waiting for LyX to show up . . ."
time.sleep(1)
count = count - 1
if count <= 0:
print 'Timeout: could not start ' + lyx_exe, '\n'
sys.stdout.flush()