7 Module implementing a special QextScintilla lexer to handle the preferences. |
7 Module implementing a special QextScintilla lexer to handle the preferences. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtGui import QColor, QFont, QApplication |
10 from PyQt4.QtGui import QColor, QFont, QApplication |
11 from PyQt4.Qsci import QsciLexer |
11 from PyQt4.Qsci import QsciLexer |
12 |
|
13 import QScintilla.Lexers |
|
14 |
12 |
15 import Preferences |
13 import Preferences |
16 |
14 |
17 |
15 |
18 class PreferencesLexerError(Exception): |
16 class PreferencesLexerError(Exception): |
70 @param parent The parent widget of this lexer. (QextScintilla) |
68 @param parent The parent widget of this lexer. (QextScintilla) |
71 """ |
69 """ |
72 super().__init__(parent) |
70 super().__init__(parent) |
73 |
71 |
74 # instantiate a lexer object for the given language |
72 # instantiate a lexer object for the given language |
|
73 import QScintilla.Lexers |
75 lex = QScintilla.Lexers.getLexer(language) |
74 lex = QScintilla.Lexers.getLexer(language) |
76 if lex is None: |
75 if lex is None: |
77 raise PreferencesLexerLanguageError(language) |
76 raise PreferencesLexerLanguageError(language) |
78 |
77 |
79 # define the local store |
78 # define the local store |