X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flyx2lyx%2FLyX.py;h=3d62da5d4b786985d3ca8c8b523ac1190d4e1ead;hb=e9cbd69f6ef3a41260f1ed4a7f66b48acdcd52a8;hp=ffaf4f0a63dbfe93aed8a71d834b2c3a2d629f25;hpb=58734edff688ae81461fffbc1f3de146d4883833;p=lyx.git diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index ffaf4f0a63..3d62da5d4b 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -621,7 +621,7 @@ class LyX_base: modlist = self.get_module_list() if module not in modlist: return False - self.set_module_list([line for line in modlist if line != "ruby"]) + self.set_module_list([line for line in modlist if line != module]) return True def get_module_list(self): @@ -797,8 +797,8 @@ class LyX_base: # this should not happen self.warning("Malformed LyX document! No \\language header found!") return - self.header[k-1 : k-1] = ["\\begin_local_layout", "\\end_local_layout"] - i = k - 1 + self.header[k : k] = ["\\begin_local_layout", "\\end_local_layout"] + i = k j = find_end_of(self.header, i, "\\begin_local_layout", "\\end_local_layout") if j == -1: @@ -808,12 +808,12 @@ class LyX_base: self.header[i+1 : i+1] = new_layout - def del_local_layout(self, old_layout): - " Delete `old_layout` from local layouts, return success." - i = find_complete_lines(self.header, old_layout) + def del_local_layout(self, layout_def): + " Delete `layout_def` from local layouts, return success." + i = find_complete_lines(self.header, layout_def) if i == -1: return False - j = i+len(old_layout) + j = i+len(layout_def) if (self.header[i-1] == "\\begin_local_layout" and self.header[j] == "\\end_local_layout"): i -=1