From 35847cdad8da0eca58fb4739126d52954a1b7e5e Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 26 Oct 2006 14:43:58 +0000 Subject: [PATCH] Make the code a bit more python-like git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15563 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_1_5.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py index 70ec731ee6..17f9f2d5e3 100644 --- a/lib/lyx2lyx/lyx_1_5.py +++ b/lib/lyx2lyx/lyx_1_5.py @@ -372,8 +372,8 @@ def convert_commandparams(document): state = "WS" # Used to handle things like \command[foo[bar]]{foo{bar}} nestdepth = 0 - for j in range(len(command)): - c = command[j] + b = 0 + for c in command: if ((state == "CMDNAME" and c == ' ') or (state == "CMDNAME" and c == '[') or (state == "CMDNAME" and c == '{')): @@ -398,10 +398,6 @@ def convert_commandparams(document): elif state == "CONTENT": argument += c elif state == "WS": - if j > 0: - b = command[j-1] - else: - b = 0 if c == '\\': state = "CMDNAME" elif c == '[' and b != ']': @@ -413,6 +409,7 @@ def convert_commandparams(document): elif c == '{': state = "CONTENT" nestdepth = 0 # Just to be sure + b = c # Now we have parsed the command, output the parameters lines = ["\\begin_inset LatexCommand %s" % name]