On Thu, Jan 16, 2003 at 02:40:08AM +0100, Michael Schmitt wrote: > Index: lib/lyx2lyx/lyxconvert_218.py > =================================================================== > RCS file: /cvs/lyx/lyx-devel/lib/lyx2lyx/lyxconvert_218.py,v > retrieving revision 1.28 > diff -u -r1.28 lyxconvert_218.py > --- lib/lyx2lyx/lyxconvert_218.py 2003/01/15 14:17:56 1.28 > +++ lib/lyx2lyx/lyxconvert_218.py 2003/01/16 01:34:36 > @@ -473,7 +473,7 @@ > i = find_token(lines, "\\begin_inset LatexCommand \\listof", i) > if i == -1: > break > - type = lines[i][33:-3] > + type = lines[i][33:-1] > lines[i] = "\\begin_inset FloatList "+type > i = i+1
This is wrong, as files created with LyX uses \begin_inset LatexCommand \listoffigures{} The shortest solution is to use a regular expression: type = re.search(r"listof(\w*)", lines[i]).group(1)[:-1]