13 |
13 |
14 import QScintilla.Lexers |
14 import QScintilla.Lexers |
15 |
15 |
16 import Preferences |
16 import Preferences |
17 |
17 |
|
18 |
18 class PreferencesLexerError(Exception): |
19 class PreferencesLexerError(Exception): |
19 """ |
20 """ |
20 Class defining a special error for the PreferencesLexer class. |
21 Class defining a special error for the PreferencesLexer class. |
21 """ |
22 """ |
22 def __init__(self): |
23 def __init__(self): |
23 """ |
24 """ |
24 Constructor |
25 Constructor |
25 """ |
26 """ |
26 self._errorMessage = \ |
27 self._errorMessage = \ |
27 QApplication.translate("PreferencesLexerError", |
28 QApplication.translate("PreferencesLexerError", |
28 "Unspecific PreferencesLexer error.") |
29 "Unspecific PreferencesLexer error.") |
29 |
30 |
30 def __repr__(self): |
31 def __repr__(self): |
31 """ |
32 """ |
32 Private method returning a representation of the exception. |
33 Private method returning a representation of the exception. |
40 Private method returning a string representation of the exception. |
41 Private method returning a string representation of the exception. |
41 |
42 |
42 @return string representing the error message |
43 @return string representing the error message |
43 """ |
44 """ |
44 return self._errorMessage |
45 return self._errorMessage |
|
46 |
45 |
47 |
46 class PreferencesLexerLanguageError(PreferencesLexerError): |
48 class PreferencesLexerLanguageError(PreferencesLexerError): |
47 """ |
49 """ |
48 Class defining a special error for the PreferencesLexer class. |
50 Class defining a special error for the PreferencesLexer class. |
49 """ |
51 """ |
54 PreferencesLexerError.__init__(self) |
56 PreferencesLexerError.__init__(self) |
55 self._errorMessage = \ |
57 self._errorMessage = \ |
56 QApplication.translate("PreferencesLexerError", |
58 QApplication.translate("PreferencesLexerError", |
57 'Unsupported Lexer Language: {0}').format(language) |
59 'Unsupported Lexer Language: {0}').format(language) |
58 |
60 |
|
61 |
59 class PreferencesLexer(QsciLexer): |
62 class PreferencesLexer(QsciLexer): |
60 """ |
63 """ |
61 Subclass of QsciLexer to implement preferences specific lexer methods. |
64 Subclass of QsciLexer to implement preferences specific lexer methods. |
62 """ |
65 """ |
63 def __init__(self, language, parent=None): |
66 def __init__(self, language, parent=None): |
64 """ |
67 """ |
65 Constructor |
68 Constructor |