예제 #1
0
 def del_from_header(self, lines):
     " Delete `lines` from the document header, return success."
     i = find_complete_lines(self.header, lines)
     if i == -1:
         return False
     j = i + len(lines)
     self.header[i:j] = []
     return True
예제 #2
0
파일: LyX.py 프로젝트: cburschka/lyx
 def del_from_header(self, lines):
     " Delete `lines` from the document header, return success."
     i = find_complete_lines(self.header, lines)
     if i == -1:
         return False
     j = i + len(lines)
     self.header[i:j] = []
     return True
예제 #3
0
 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(layout_def)
     if (self.header[i - 1] == "\\begin_local_layout"
             and self.header[j] == "\\end_local_layout"):
         i -= 1
         j += 1
     self.header[i:j] = []
     return True
예제 #4
0
파일: LyX.py 프로젝트: cburschka/lyx
 def del_local_layout(self, old_layout):
     " Delete `old_layout` from local layouts, return success."
     i = find_complete_lines(self.header, old_layout)
     if i == -1:
         return False
     j = i+len(old_layout)
     if (self.header[i-1] == "\\begin_local_layout" and
         self.header[j] == "\\end_local_layout"):
         i -=1
         j +=1
     self.header[i:j] = []
     return True