]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/parser_tools.py
half-functional lyx2lyx reversion
[lyx.git] / lib / lyx2lyx / parser_tools.py
index cfc6a75433fe5ccd5ffda0dfdd668ade7ace7e78..e32ac5dc4fca7d879a933e8f9c0d7550aa800716 100644 (file)
@@ -15,7 +15,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 
 ''' 
@@ -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