]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/parser_tools.py
ePub: share a bit of code for parsing arguments.
[lyx.git] / lib / lyx2lyx / parser_tools.py
index 175db00ac3b21de3bc335204a435261f57aec90a..895a4cde77f3b6e2521687427eca3616c4de0310 100644 (file)
@@ -1,7 +1,7 @@
 # This file is part of lyx2lyx
 # -*- coding: utf-8 -*-
 # Copyright (C) 2002-2011 Dekel Tsur <dekel@lyx.org>,
-# José Matos <jamatos@lyx.org>, Richard Heck <rgheck@comcast.net>
+# José Matos <jamatos@lyx.org>, Richard Kimberly Heck <rikiheck@lyx.org>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -66,6 +66,7 @@ get_value(lines, token[, start[, end[, default[, delete]]]]):
   is stripped.) The final argument, default, defaults to "",
   and is what is returned if we do not find anything. So you
   can use that to set a default.
+  If delete is True, then delete the line if found.
 
 get_quoted_value(lines, token[, start[, end[, default[, delete]]]]):
   Similar to get_value, but it will strip quotes off the
@@ -688,7 +689,7 @@ def count_pars_in_inset(lines, i):
   pars = 0
   for j in range(ins[1], ins[2]):
       m = re.match(r'\\begin_layout (.*)', lines[j])
-      if m and get_containing_inset(lines, j)[0] == ins[0]:
+      if m and get_containing_inset(lines, j)[1] == ins[1]:
           pars += 1
 
   return pars