]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/parser_tools.py
More sensible longtable caption handling (needed for bug #7412)
[lyx.git] / lib / lyx2lyx / parser_tools.py
index 31948fe30c90d6f25b540b7bf6585c7e20d439b0..e32ac5dc4fca7d879a933e8f9c0d7550aa800716 100644 (file)
@@ -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