]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/parser_tools.py
Correct naming for view-split.
[lyx.git] / lib / lyx2lyx / parser_tools.py
index 47bee707eaea8de372ab2ee7d1e7269d5e7e9a38..e32ac5dc4fca7d879a933e8f9c0d7550aa800716 100644 (file)
@@ -307,7 +307,7 @@ def get_quoted_value(lines, token, start, end = 0, default = ""):
 
 
 def get_option_value(line, option):
-    rx = option + '\s*=\s*"([^"+])"'
+    rx = option + '\s*=\s*"([^"]+)"'
     rx = re.compile(rx)
     m = rx.search(line)
     if not m:
@@ -315,6 +315,15 @@ def get_option_value(line, option):
     return m.group(1)
 
 
+def set_option_value(line, option, value):
+    rx = '(' + option + '\s*=\s*")[^"]+"'
+    rx = re.compile(rx)
+    m = rx.search(line)
+    if not m:
+        return line
+    return re.sub(rx, '\g<1>' + value + '"', line)
+
+
 def del_token(lines, token, start, end = 0):
     """ del_token(lines, token, start, end) -> int