mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
keytests: Implemented use of additional shortcuts in keytest.py
Now, before starting a test with 'TestBegin' in any *-in.txt file we can create ne shortcuts used by this test. Defining a shortcut: UseShortcut "<shortcut>" "<function>" Actually adding the new shortcuts to be used by the next lyx-session: PrepareShortcuts Use example is found in findadv-combined-in.txt The UseShortcut-entries will be traslated into '\bind "<shortcut>" "<function>"' and with the PrepareShortcuts-entry added to the active use file 'user.bind'
This commit is contained in:
parent
125154dbf1
commit
fa3e656af7
@ -1,4 +1,7 @@
|
|||||||
# Finding special latex/regexp chars: \
|
# Finding special latex/regexp chars: \
|
||||||
|
UseShortcut "C-F20" "regexp-mode"
|
||||||
|
UseShortcut "C-F21" "command-sequence dialog-show findreplaceadv ; buffer-end ; buffer-begin-select ; char-delete-forward ;"
|
||||||
|
PrepareShortcuts
|
||||||
#
|
#
|
||||||
Lang sk_SK.utf8
|
Lang sk_SK.utf8
|
||||||
TestBegin test.lyx -dbg key,find > findadv-combined.loga.txt 2>&1
|
TestBegin test.lyx -dbg key,find > findadv-combined.loga.txt 2>&1
|
||||||
@ -24,83 +27,53 @@ KK: \Cs
|
|||||||
#
|
#
|
||||||
KK: \[Escape]\C\[Home]
|
KK: \[Escape]\C\[Home]
|
||||||
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
|
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
|
||||||
CN: Searching for '@'
|
CN: Part 001
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\@\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\@\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\@'
|
CP: Escaped : '\@'
|
||||||
CR: [pP]utting selection at .*idx: 0 par: 0 pos: 10\n with len: 1
|
CR: [pP]utting selection at .*idx: 0 par: 0 pos: 10\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '('
|
CN: Part 002
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\(\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\(\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\('
|
CP: Escaped : '\('
|
||||||
CP: Putting selection at .*idx: 0 par: 1 pos: 1\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 1 pos: 1\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for ')'
|
CN: Part 003
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\)\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\)\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\)'
|
CP: Escaped : '\)'
|
||||||
CP: Putting selection at .*idx: 0 par: 1 pos: 2\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 1 pos: 2\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '\\'
|
CN: Part 004
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\\\\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\\\\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaping: '\backslash\backslash'
|
CP: Escaping: '\backslash\backslash'
|
||||||
CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '%'
|
CN: Part 005
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]%\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]%\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '%'
|
CP: Escaped : '%'
|
||||||
CP: Putting selection at .*idx: 0 par: 2 pos: 7\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 2 pos: 7\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '^'
|
CN: Part 006
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\^\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\^\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\^'
|
CP: Escaped : '\^'
|
||||||
CP: Putting selection at .*idx: 0 par: 2 pos: 8\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 2 pos: 8\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '['
|
CN: Part 007
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\[\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\[\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\['
|
CP: Escaped : '\['
|
||||||
CP: Putting selection at .*idx: 0 par: 3 pos: 3\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 3 pos: 3\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for ']'
|
CN: Part 008
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\]\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\]\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\]'
|
CP: Escaped : '\]'
|
||||||
CP: Putting selection at .*idx: 0 par: 3 pos: 4\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 3 pos: 4\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '{'
|
CN: Part 009
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\{\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\{\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaping: '\backslash\{'
|
CP: Escaping: '\backslash\{'
|
||||||
CP: Putting selection at .*idx: 0 par: 3 pos: 5\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 3 pos: 5\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '}'
|
CN: Part 010
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\}\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\}\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaping: '\backslash\}'
|
CP: Escaping: '\backslash\}'
|
||||||
CP: Putting selection at .*idx: 0 par: 3 pos: 6\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 3 pos: 6\n with len: 1
|
||||||
|
|
||||||
@ -117,88 +90,57 @@ KK: \[Escape]\C\[Home]
|
|||||||
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
|
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
|
||||||
|
|
||||||
#
|
#
|
||||||
CN: Searching for '['
|
CN: Part 101
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\[\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\[\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\['
|
CP: Escaped : '\['
|
||||||
CP: Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '('
|
CN: Part 102
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\(\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\(\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\('
|
CP: Escaped : '\('
|
||||||
CP: Putting selection at .*idx: 0 par: 1 pos: 1\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 1 pos: 1\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for ')'
|
CN: Part 103
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\)\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\)\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\)'
|
CP: Escaped : '\)'
|
||||||
CP: Putting selection at .*idx: 0 par: 1 pos: 2\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 1 pos: 2\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '\\'
|
CN: Part 104
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\\\\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\\\\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\\'
|
CP: Escaped : '\\'
|
||||||
CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '%'
|
CN: Part 105
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]%\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]%\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '%'
|
CP: Escaped : '%'
|
||||||
CP: Putting selection at .*idx: 0 par: 2 pos: 7\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 2 pos: 7\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '^'
|
CN: Part 105
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\^\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
# Uncheck ignore format
|
|
||||||
KK: \Axregexp-mode\[Return]\\^\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\^'
|
CP: Escaped : '\^'
|
||||||
CP: Putting selection at .*idx: 0 par: 2 pos: 8\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 2 pos: 8\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '{'
|
CN: Part 106
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\{\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\{\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaping: '\backslash\{'
|
CP: Escaping: '\backslash\{'
|
||||||
CP: Putting selection at .*idx: 0 par: 3 pos: 5\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 3 pos: 5\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '}'
|
CN: Part 107
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\}\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\}\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaping: '\backslash\}'
|
CP: Escaping: '\backslash\}'
|
||||||
CP: Putting selection at .*idx: 0 par: 3 pos: 6\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 3 pos: 6\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for ']'
|
CN: Part 108
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\]\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\]\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\]'
|
CP: Escaped : '\]'
|
||||||
CP: Putting selection at .*idx: 0 par: 4 pos: 4\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 4 pos: 4\n with len: 1
|
||||||
#
|
#
|
||||||
CN: Searching for '@'
|
CN: Part 109
|
||||||
KK: \CF
|
KK: \C\[F21]\C\[F20]\\@\[Return]
|
||||||
KK: \[Delete]
|
|
||||||
KK: \Axregexp-mode\[Return]\\@\[Return]
|
|
||||||
KK: \[Escape]
|
|
||||||
CP: Escaped : '\@'
|
CP: Escaped : '\@'
|
||||||
CP: Putting selection at .*idx: 0 par: 4 pos: 10\n with len: 1
|
CP: Putting selection at .*idx: 0 par: 4 pos: 10\n with len: 1
|
||||||
|
|
||||||
#
|
#
|
||||||
TestEnd
|
TestEnd
|
||||||
CC:
|
Lang C
|
||||||
Assert searchPatterns.pl log=findadv-combined.loga.txt patterns=findadv-combined.ctrl
|
Assert searchPatterns.pl log=findadv-combined.loga.txt patterns=findadv-combined.ctrl
|
||||||
|
@ -14,6 +14,9 @@ import os
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import tempfile
|
||||||
|
import shutil
|
||||||
|
|
||||||
#from subprocess import call
|
#from subprocess import call
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
@ -22,6 +25,7 @@ print('Beginning keytest.py')
|
|||||||
FNULL = open('/dev/null', 'w')
|
FNULL = open('/dev/null', 'w')
|
||||||
|
|
||||||
key_delay = ''
|
key_delay = ''
|
||||||
|
bindings = {}
|
||||||
|
|
||||||
# Ignore status == "dead" if this is set. Used at the last commands after "\Cq"
|
# Ignore status == "dead" if this is set. Used at the last commands after "\Cq"
|
||||||
dead_expected = False
|
dead_expected = False
|
||||||
@ -213,9 +217,7 @@ class ControlFile:
|
|||||||
elif command == "CC":
|
elif command == "CC":
|
||||||
self.close()
|
self.close()
|
||||||
else:
|
else:
|
||||||
if self.cntrfile is None:
|
if not self.cntrfile is None:
|
||||||
print("Controlfile not initialized")
|
|
||||||
else:
|
|
||||||
if command == "CN":
|
if command == "CN":
|
||||||
self.__addline("Comment: " + text)
|
self.__addline("Comment: " + text)
|
||||||
elif command == "CP":
|
elif command == "CP":
|
||||||
@ -453,10 +455,10 @@ def sendKeystringRT(line, LYX_PID):
|
|||||||
|
|
||||||
def system_retry(num_retry, cmd):
|
def system_retry(num_retry, cmd):
|
||||||
i = 0
|
i = 0
|
||||||
rtn = intr_system(cmd)
|
rtn = intr_system(cmd, True)
|
||||||
while ( ( i < num_retry ) and ( rtn != 0) ):
|
while ( ( i < num_retry ) and ( rtn != 0) ):
|
||||||
i = i + 1
|
i = i + 1
|
||||||
rtn = intr_system(cmd)
|
rtn = intr_system(cmd, True)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if ( rtn != 0 ):
|
if ( rtn != 0 ):
|
||||||
print("Command Failed: "+cmd)
|
print("Command Failed: "+cmd)
|
||||||
@ -470,6 +472,59 @@ def RaiseWindow():
|
|||||||
intr_system("wmctrl -R '"+lyx_window_name+"' ;sleep 0.1")
|
intr_system("wmctrl -R '"+lyx_window_name+"' ;sleep 0.1")
|
||||||
system_retry(30, "wmctrl -i -a '"+lyx_window_name+"'")
|
system_retry(30, "wmctrl -i -a '"+lyx_window_name+"'")
|
||||||
|
|
||||||
|
shortcut_entry = re.compile(r'^\s*"([^"]+)"\s*\"([^"]+)\"')
|
||||||
|
def UseShortcut(c):
|
||||||
|
m = shortcut_entry.match(c)
|
||||||
|
if m:
|
||||||
|
sh = m.group(1)
|
||||||
|
fkt = m.group(2)
|
||||||
|
bindings[sh] = fkt
|
||||||
|
else:
|
||||||
|
die(1, "cad shortcut spec(" + c + ")")
|
||||||
|
|
||||||
|
def PrepareShortcuts():
|
||||||
|
bind = re.compile(r'^\s*\\bind\s+"([^"]+)"')
|
||||||
|
if lyx_userdir_ver is None:
|
||||||
|
dir = lyx_userdir
|
||||||
|
else:
|
||||||
|
dir = lyx_userdir_ver
|
||||||
|
if not dir is None:
|
||||||
|
tmp = tempfile.NamedTemporaryFile(suffix='.bind', delete=False)
|
||||||
|
try:
|
||||||
|
old = open(dir + '/bind/user.bind', 'r')
|
||||||
|
except IOError as e:
|
||||||
|
old = None
|
||||||
|
if not old is None:
|
||||||
|
lines = old.read().split("\n")
|
||||||
|
old.close()
|
||||||
|
bindfound = False
|
||||||
|
for line in lines:
|
||||||
|
m = bind.match(line)
|
||||||
|
if m:
|
||||||
|
bindfound = True
|
||||||
|
val = m.group(1)
|
||||||
|
if not bindings[val] is None:
|
||||||
|
if bindings[val] != "":
|
||||||
|
tmp.write("\\bind \"" + val + "\" \"" + bindings[val] + "\"\n")
|
||||||
|
bindings[val] = ""
|
||||||
|
else:
|
||||||
|
tmp.write(line + '\n')
|
||||||
|
elif not bindfound:
|
||||||
|
tmp.write(line + '\n')
|
||||||
|
else:
|
||||||
|
tmp.writelines(
|
||||||
|
'## This file is used for keytests only\n\n' +
|
||||||
|
'Format 4\n\n'
|
||||||
|
)
|
||||||
|
for val in bindings:
|
||||||
|
if not bindings[val] is None:
|
||||||
|
if bindings[val] != "":
|
||||||
|
tmp.write("\\bind \"" + val + "\" \"" + bindings[val] + "\"\n")
|
||||||
|
bindings[val] = ""
|
||||||
|
tmp.close()
|
||||||
|
shutil.move(tmp.name, dir + '/bind/user.bind')
|
||||||
|
else:
|
||||||
|
print("User dir not specified")
|
||||||
|
|
||||||
lyx_pid = os.environ.get('LYX_PID')
|
lyx_pid = os.environ.get('LYX_PID')
|
||||||
print('lyx_pid: ' + str(lyx_pid) + '\n')
|
print('lyx_pid: ' + str(lyx_pid) + '\n')
|
||||||
@ -480,6 +535,7 @@ lyx_window_name = os.environ.get('LYX_WINDOW_NAME')
|
|||||||
lyx_other_window_name = None
|
lyx_other_window_name = None
|
||||||
screenshot_out = os.environ.get('SCREENSHOT_OUT')
|
screenshot_out = os.environ.get('SCREENSHOT_OUT')
|
||||||
lyx_userdir = os.environ.get('LYX_USERDIR')
|
lyx_userdir = os.environ.get('LYX_USERDIR')
|
||||||
|
lyx_userdir_ver = os.environ.get('LYX_USERDIR_23x')
|
||||||
|
|
||||||
max_loops = os.environ.get('MAX_LOOPS')
|
max_loops = os.environ.get('MAX_LOOPS')
|
||||||
if max_loops is None:
|
if max_loops is None:
|
||||||
@ -640,6 +696,11 @@ while not failed:
|
|||||||
elif c == 'RaiseLyx':
|
elif c == 'RaiseLyx':
|
||||||
print('Raising Lyx')
|
print('Raising Lyx')
|
||||||
RaiseWindow()
|
RaiseWindow()
|
||||||
|
elif c == 'PrepareShortcuts':
|
||||||
|
print('Preparing usefull sortcuts for tests')
|
||||||
|
PrepareShortcuts()
|
||||||
|
elif c[0:12] == 'UseShortcut ':
|
||||||
|
UseShortcut(c[12:])
|
||||||
elif c[0:4] == 'KK: ':
|
elif c[0:4] == 'KK: ':
|
||||||
if lyx_exists():
|
if lyx_exists():
|
||||||
sendKeystringRT(c[4:], lyx_pid)
|
sendKeystringRT(c[4:], lyx_pid)
|
||||||
@ -657,7 +718,7 @@ while not failed:
|
|||||||
sendKeystringRT(ResetCommand, lyx_pid)
|
sendKeystringRT(ResetCommand, lyx_pid)
|
||||||
elif c[0:6] == 'Assert':
|
elif c[0:6] == 'Assert':
|
||||||
cmd = c[7:].rstrip()
|
cmd = c[7:].rstrip()
|
||||||
result = intr_system(cmd)
|
result = intr_system(cmd, True)
|
||||||
failed = failed or (result != 0)
|
failed = failed or (result != 0)
|
||||||
print("result=" + str(result) + ", failed=" + str(failed))
|
print("result=" + str(result) + ", failed=" + str(failed))
|
||||||
elif c[0:15] == 'TestEndWithKill':
|
elif c[0:15] == 'TestEndWithKill':
|
||||||
@ -676,16 +737,16 @@ while not failed:
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
if cmd != "":
|
if cmd != "":
|
||||||
print("Executing " + cmd)
|
print("Executing " + cmd)
|
||||||
result = intr_system(cmd)
|
result = intr_system(cmd, True)
|
||||||
failed = failed or (result != 0)
|
failed = failed or (result != 0)
|
||||||
print("result=" + str(result) + ", failed=" + str(failed))
|
print("result=" + str(result) + ", failed=" + str(failed))
|
||||||
else:
|
else:
|
||||||
print("failed=" + str(failed))
|
print("failed=" + str(failed))
|
||||||
elif c[0:7] == 'TestEnd':
|
elif c[0:7] == 'TestEnd':
|
||||||
marked.close()
|
#lyx_other_window_name = None
|
||||||
#lyx_other_window_name = None
|
|
||||||
if lyx_dead(lyx_pid):
|
if lyx_dead(lyx_pid):
|
||||||
print("LyX instance not found because of crash or assert !\n")
|
print("LyX instance not found because of crash or assert !\n")
|
||||||
|
marked.close()
|
||||||
failed = True
|
failed = True
|
||||||
else:
|
else:
|
||||||
print(" ------------ Forcing quit of lyx instance: " + str(lyx_pid) + " ------------")
|
print(" ------------ Forcing quit of lyx instance: " + str(lyx_pid) + " ------------")
|
||||||
@ -695,6 +756,8 @@ while not failed:
|
|||||||
# now we should be outside any dialog
|
# now we should be outside any dialog
|
||||||
# and so the function lyx-quit should work
|
# and so the function lyx-quit should work
|
||||||
sendKeystringLocal("\Cq", lyx_pid)
|
sendKeystringLocal("\Cq", lyx_pid)
|
||||||
|
marked.dispatch('CP: action=lyx-quit')
|
||||||
|
marked.close()
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
dead_expected = True
|
dead_expected = True
|
||||||
is_sleeping = wait_until_lyx_sleeping(lyx_pid)
|
is_sleeping = wait_until_lyx_sleeping(lyx_pid)
|
||||||
@ -718,7 +781,7 @@ while not failed:
|
|||||||
cmd = c[8:].rstrip()
|
cmd = c[8:].rstrip()
|
||||||
if cmd != "":
|
if cmd != "":
|
||||||
print("Executing " + cmd)
|
print("Executing " + cmd)
|
||||||
result = intr_system(cmd)
|
result = intr_system(cmd, True)
|
||||||
failed = failed or (result != 0)
|
failed = failed or (result != 0)
|
||||||
print("result=" + str(result) + ", failed=" + str(failed))
|
print("result=" + str(result) + ", failed=" + str(failed))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user