eric6/QScintilla/Lexers/LexerProperties.py

changeset 8243
cc717c2ae956
parent 7923
91e843545d9a
equal deleted inserted replaced
8242:aa713ac50c0d 8243:cc717c2ae956
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a Properties lexer with some additional methods. 7 Module implementing a Properties lexer with some additional methods.
8 """ 8 """
9
10 import contextlib
9 11
10 from PyQt5.Qsci import QsciLexerProperties 12 from PyQt5.Qsci import QsciLexerProperties
11 13
12 from .Lexer import Lexer 14 from .Lexer import Lexer
13 import Preferences 15 import Preferences
33 def initProperties(self): 35 def initProperties(self):
34 """ 36 """
35 Public slot to initialize the properties. 37 Public slot to initialize the properties.
36 """ 38 """
37 self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) 39 self.setFoldCompact(Preferences.getEditor("AllFoldCompact"))
38 try: 40 with contextlib.suppress(AttributeError):
39 self.setInitialSpaces( 41 self.setInitialSpaces(
40 Preferences.getEditor("PropertiesInitialSpaces")) 42 Preferences.getEditor("PropertiesInitialSpaces"))
41 except AttributeError:
42 pass
43 43
44 def isCommentStyle(self, style): 44 def isCommentStyle(self, style):
45 """ 45 """
46 Public method to check, if a style is a comment style. 46 Public method to check, if a style is a comment style.
47 47

eric ide

mercurial