QScintilla/Exporters/ExporterTEX.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3058
0a02c433f52d
parent 3039
8dd0165d805d
child 3145
a9de05d4a22f
equal deleted inserted replaced
3058:0a02c433f52d 3060:5883ce99ee12
130 titleFullPath = Preferences.getEditorExporter( 130 titleFullPath = Preferences.getEditorExporter(
131 "TeX/FullPathAsTitle") 131 "TeX/FullPathAsTitle")
132 132
133 lex = self.editor.getLexer() 133 lex = self.editor.getLexer()
134 self.defaultPaper = lex and \ 134 self.defaultPaper = lex and \
135 lex.paper(QsciScintilla.STYLE_DEFAULT) or \ 135 lex.paper(QsciScintilla.STYLE_DEFAULT) or \
136 self.editor.paper().name() 136 self.editor.paper().name()
137 self.defaultColor = lex and \ 137 self.defaultColor = lex and \
138 lex.color(QsciScintilla.STYLE_DEFAULT) or \ 138 lex.color(QsciScintilla.STYLE_DEFAULT) or \
139 self.editor.color().name() 139 self.editor.color().name()
140 self.defaultFont = lex and \ 140 self.defaultFont = lex and \
141 lex.color(QsciScintilla.STYLE_DEFAULT) or \ 141 lex.color(QsciScintilla.STYLE_DEFAULT) or \
142 Preferences.getEditorOtherFonts("DefaultFont") 142 Preferences.getEditorOtherFonts("DefaultFont")
143 143
144 lengthDoc = self.editor.length() 144 lengthDoc = self.editor.length()
145 styleIsUsed = {} 145 styleIsUsed = {}
146 if onlyStylesUsed: 146 if onlyStylesUsed:
147 for index in range(QsciScintilla.STYLE_MAX + 1): 147 for index in range(QsciScintilla.STYLE_MAX + 1):
171 f.write("\\usepackage[latin1]{inputenc}\n") 171 f.write("\\usepackage[latin1]{inputenc}\n")
172 172
173 if lex: 173 if lex:
174 istyle = 0 174 istyle = 0
175 while istyle <= QsciScintilla.STYLE_MAX: 175 while istyle <= QsciScintilla.STYLE_MAX:
176 if (istyle <= QsciScintilla.STYLE_DEFAULT or \ 176 if (istyle <= QsciScintilla.STYLE_DEFAULT or
177 istyle > QsciScintilla.STYLE_LASTPREDEFINED) and \ 177 istyle > QsciScintilla.STYLE_LASTPREDEFINED) and \
178 styleIsUsed[istyle]: 178 styleIsUsed[istyle]:
179 if lex.description(istyle) or \ 179 if lex.description(istyle) or \
180 istyle == QsciScintilla.STYLE_DEFAULT: 180 istyle == QsciScintilla.STYLE_DEFAULT:
181 font = lex.font(istyle) 181 font = lex.font(istyle)
272 E5MessageBox.critical( 272 E5MessageBox.critical(
273 self.editor, 273 self.editor,
274 self.trUtf8("Export source"), 274 self.trUtf8("Export source"),
275 self.trUtf8( 275 self.trUtf8(
276 """<p>The source could not be exported to""" 276 """<p>The source could not be exported to"""
277 """ <b>{0}</b>.</p><p>Reason: {1}</p>""")\ 277 """ <b>{0}</b>.</p><p>Reason: {1}</p>""")
278 .format(filename, str(err))) 278 .format(filename, str(err)))
279 finally: 279 finally:
280 QApplication.restoreOverrideCursor() 280 QApplication.restoreOverrideCursor()

eric ide

mercurial