]> git.lyx.org Git - features.git/commitdiff
Fix indentation (from 2 spaces to 4) in lyx_1_6.py
authorBo Peng <bpeng@lyx.org>
Sun, 7 Oct 2007 14:26:16 +0000 (14:26 +0000)
committerBo Peng <bpeng@lyx.org>
Sun, 7 Oct 2007 14:26:16 +0000 (14:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20818 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/lyx_1_6.py

index 866c65d11c6883711706513924ad9d87eab899b7..4dd314c0763ffede49ca823be537bbef45a0bcac 100644 (file)
@@ -257,66 +257,66 @@ def remove_inzip_options(document):
 
 
 def convert_inset_command(document):
-  """
-    Convert:
-      \begin_inset LatexCommand cmd 
-    to 
-      \begin_inset CommandInset InsetType
-      LatexCommand cmd
-  """
-  i = 0
-  while 1:
-    i = find_token(document.body, "\\begin_inset LatexCommand", i)
-    if i == -1:
-      return
-    line = document.body[i]
-    r = re.compile(r'\\begin_inset LatexCommand (.*)$')
-    m = r.match(line)
-    cmdName = m.group(1)
-    insetName = ""
-    #this is adapted from factory.cpp
-    if cmdName[0:4].lower() == "cite":
-      insetName = "citation"
-    elif cmdName == "url" or cmdName == "htmlurl":
-      insetName = "url"
-    elif cmdName[-3:] == "ref":
-      insetName = "ref"
-    elif cmdName == "tableofcontents":
-      insetName = "toc"
-    elif cmdName == "printnomenclature":
-      insetName = "nomencl_print"
-    elif cmdName == "printindex":
-      insetName = "index_print"
-    else:
-      insetName = cmdName
-    insertion = ["\\begin_inset CommandInset " + insetName, "LatexCommand " + cmdName]
-    document.body[i : i+1] = insertion
+    """
+        Convert:
+            \begin_inset LatexCommand cmd 
+        to 
+            \begin_inset CommandInset InsetType
+            LatexCommand cmd
+    """
+    i = 0
+    while 1:
+        i = find_token(document.body, "\\begin_inset LatexCommand", i)
+        if i == -1:
+            return
+        line = document.body[i]
+        r = re.compile(r'\\begin_inset LatexCommand (.*)$')
+        m = r.match(line)
+        cmdName = m.group(1)
+        insetName = ""
+        #this is adapted from factory.cpp
+        if cmdName[0:4].lower() == "cite":
+            insetName = "citation"
+        elif cmdName == "url" or cmdName == "htmlurl":
+            insetName = "url"
+        elif cmdName[-3:] == "ref":
+            insetName = "ref"
+        elif cmdName == "tableofcontents":
+            insetName = "toc"
+        elif cmdName == "printnomenclature":
+            insetName = "nomencl_print"
+        elif cmdName == "printindex":
+            insetName = "index_print"
+        else:
+            insetName = cmdName
+        insertion = ["\\begin_inset CommandInset " + insetName, "LatexCommand " + cmdName]
+        document.body[i : i+1] = insertion
 
 
 def revert_inset_command(document):
-  """
-    Convert:
-      \begin_inset CommandInset InsetType
-      LatexCommand cmd
-    to 
-      \begin_inset LatexCommand cmd 
-    Some insets may end up being converted to insets earlier versions of LyX
-    will not be able to recognize. Not sure what to do about that.
-  """
-  i = 0
-  while 1:
-    i = find_token(document.body, "\\begin_inset CommandInset", i)
-    if i == -1:
-      return
-    nextline = document.body[i+1]
-    r = re.compile(r'LatexCommand\s+(.*)$')
-    m = r.match(nextline)
-    if not m:
-      document.warning("Malformed LyX document: Missing LatexCommand in " + document.body[i] + ".")
-      continue
-    cmdName = m.group(1)
-    insertion = ["\\begin_inset LatexCommand " + cmdName]
-    document.body[i : i+2] = insertion
+    """
+        Convert:
+            \begin_inset CommandInset InsetType
+            LatexCommand cmd
+        to 
+            \begin_inset LatexCommand cmd 
+        Some insets may end up being converted to insets earlier versions of LyX
+        will not be able to recognize. Not sure what to do about that.
+    """
+    i = 0
+    while 1:
+        i = find_token(document.body, "\\begin_inset CommandInset", i)
+        if i == -1:
+            return
+        nextline = document.body[i+1]
+        r = re.compile(r'LatexCommand\s+(.*)$')
+        m = r.match(nextline)
+        if not m:
+            document.warning("Malformed LyX document: Missing LatexCommand in " + document.body[i] + ".")
+            continue
+        cmdName = m.group(1)
+        insertion = ["\\begin_inset LatexCommand " + cmdName]
+        document.body[i : i+2] = insertion
 
 
 def convert_wrapfig_options(document):