src/eric7/Preferences/PreferencesLexer.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
16 16
17 class PreferencesLexerError(Exception): 17 class PreferencesLexerError(Exception):
18 """ 18 """
19 Class defining a special error for the PreferencesLexer class. 19 Class defining a special error for the PreferencesLexer class.
20 """ 20 """
21
21 def __init__(self): 22 def __init__(self):
22 """ 23 """
23 Constructor 24 Constructor
24 """ 25 """
25 self._errorMessage = QCoreApplication.translate( 26 self._errorMessage = QCoreApplication.translate(
26 "PreferencesLexerError", 27 "PreferencesLexerError", "Unspecific PreferencesLexer error."
27 "Unspecific PreferencesLexer error.") 28 )
28 29
29 def __repr__(self): 30 def __repr__(self):
30 """ 31 """
31 Special method returning a representation of the exception. 32 Special method returning a representation of the exception.
32 33
33 @return string representing the error message 34 @return string representing the error message
34 @rtype str 35 @rtype str
35 """ 36 """
36 return repr(self._errorMessage) 37 return repr(self._errorMessage)
37 38
38 def __str__(self): 39 def __str__(self):
39 """ 40 """
40 Special method returning a string representation of the exception. 41 Special 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 @rtype str 44 @rtype str
44 """ 45 """
45 return self._errorMessage 46 return self._errorMessage
46 47
47 48
48 class PreferencesLexerLanguageError(PreferencesLexerError): 49 class PreferencesLexerLanguageError(PreferencesLexerError):
49 """ 50 """
50 Class defining a special error for the PreferencesLexer class. 51 Class defining a special error for the PreferencesLexer class.
51 """ 52 """
53
52 def __init__(self, language): 54 def __init__(self, language):
53 """ 55 """
54 Constructor 56 Constructor
55 57
56 @param language lexer language 58 @param language lexer language
57 @type str 59 @type str
58 """ 60 """
59 PreferencesLexerError.__init__(self) 61 PreferencesLexerError.__init__(self)
60 self._errorMessage = QCoreApplication.translate( 62 self._errorMessage = QCoreApplication.translate(
61 "PreferencesLexerError", 63 "PreferencesLexerError", "Unsupported Lexer Language: {0}"
62 'Unsupported Lexer Language: {0}').format(language) 64 ).format(language)
63 65
64 66
65 class PreferencesLexer(QObject): 67 class PreferencesLexer(QObject):
66 """ 68 """
67 Class implementing a Lexer facade for the highlighting styles 69 Class implementing a Lexer facade for the highlighting styles
68 configuration. 70 configuration.
69 """ 71 """
72
70 def __init__(self, language, parent=None): 73 def __init__(self, language, parent=None):
71 """ 74 """
72 Constructor 75 Constructor
73 76
74 @param language language of the lexer 77 @param language language of the lexer
75 @type str 78 @type str
76 @param parent parent widget of this lexer (QWidget) 79 @param parent parent widget of this lexer (QWidget)
77 @exception PreferencesLexerLanguageError raised to indicate an invalid 80 @exception PreferencesLexerLanguageError raised to indicate an invalid
78 lexer language 81 lexer language
79 """ 82 """
80 super().__init__(parent) 83 super().__init__(parent)
81 84
82 # These default font families are taken from QScintilla 85 # These default font families are taken from QScintilla
83 if Globals.isWindowsPlatform(): 86 if Globals.isWindowsPlatform():
84 self.__defaultFontFamily = "Courier New" 87 self.__defaultFontFamily = "Courier New"
85 elif Globals.isMacPlatform(): 88 elif Globals.isMacPlatform():
86 self.__defaultFontFamily = "Courier" 89 self.__defaultFontFamily = "Courier"
87 else: 90 else:
88 self.__defaultFontFamily = "Bitstream Vera Sans Mono" 91 self.__defaultFontFamily = "Bitstream Vera Sans Mono"
89 92
90 # instantiate a lexer object for the given language 93 # instantiate a lexer object for the given language
91 import QScintilla.Lexers 94 import QScintilla.Lexers
95
92 self.__lex = QScintilla.Lexers.getLexer(language) 96 self.__lex = QScintilla.Lexers.getLexer(language)
93 if self.__lex is None: 97 if self.__lex is None:
94 raise PreferencesLexerLanguageError(language) 98 raise PreferencesLexerLanguageError(language)
95 99
96 # read the last stored values from preferences file 100 # read the last stored values from preferences file
97 self.__lex.readSettings(Preferences.getSettings(), "Scintilla") 101 self.__lex.readSettings(Preferences.getSettings(), "Scintilla")
98 if self.__lex.hasSubstyles(): 102 if self.__lex.hasSubstyles():
99 self.__lex.loadSubstyles() 103 self.__lex.loadSubstyles()
100 104
101 def writeSettings(self): 105 def writeSettings(self):
102 """ 106 """
103 Public method to write the lexer settings. 107 Public method to write the lexer settings.
104 """ 108 """
105 self.__lex.writeSettings(Preferences.getSettings(), "Scintilla") 109 self.__lex.writeSettings(Preferences.getSettings(), "Scintilla")
106 if self.__lex.hasSubstyles(): 110 if self.__lex.hasSubstyles():
107 self.__lex.writeSubstyles() 111 self.__lex.writeSubstyles()
108 112
109 def getStyles(self): 113 def getStyles(self):
110 """ 114 """
111 Public method to get a list of all supported styles. 115 Public method to get a list of all supported styles.
112 116
113 @return list of tuples each containing the description of the style, 117 @return list of tuples each containing the description of the style,
114 style number and sub-style number (or -1 for no sub-style) 118 style number and sub-style number (or -1 for no sub-style)
115 @rtype list of tuples of (str, int, int) 119 @rtype list of tuples of (str, int, int)
116 """ 120 """
117 styles = [] 121 styles = []
118 122
119 for i in range(QsciScintillaBase.STYLE_MAX): 123 for i in range(QsciScintillaBase.STYLE_MAX):
120 desc = self.__lex.description(i) 124 desc = self.__lex.description(i)
121 if desc: 125 if desc:
122 styles.append((desc, i, -1)) 126 styles.append((desc, i, -1))
123 if self.__lex.hasSubstyles(): 127 if self.__lex.hasSubstyles():
124 for baseStyle in self.__lex.getBaseStyles(): 128 for baseStyle in self.__lex.getBaseStyles():
125 for subStyle in range(self.__lex.substylesCount(baseStyle)): 129 for subStyle in range(self.__lex.substylesCount(baseStyle)):
126 desc = self.__lex.substyleDescription(baseStyle, subStyle) 130 desc = self.__lex.substyleDescription(baseStyle, subStyle)
127 styles.append((desc, baseStyle, subStyle)) 131 styles.append((desc, baseStyle, subStyle))
128 132
129 return styles 133 return styles
130 134
131 def getSubStyles(self, style): 135 def getSubStyles(self, style):
132 """ 136 """
133 Public method to get a list of all sub-styles of a style. 137 Public method to get a list of all sub-styles of a style.
134 138
135 @param style style number 139 @param style style number
136 @type int 140 @type int
137 @return list of tuples each containing the description of the style, 141 @return list of tuples each containing the description of the style,
138 style number and sub-style number (or -1 for no sub-style) 142 style number and sub-style number (or -1 for no sub-style)
139 @rtype list of tuples of (str, int, int) 143 @rtype list of tuples of (str, int, int)
140 """ 144 """
141 styles = [] 145 styles = []
142 146
143 if self.isBaseStyle(style): 147 if self.isBaseStyle(style):
144 for subStyle in range(self.__lex.substylesCount(style)): 148 for subStyle in range(self.__lex.substylesCount(style)):
145 desc = self.__lex.substyleDescription(style, subStyle) 149 desc = self.__lex.substyleDescription(style, subStyle)
146 styles.append((desc, style, subStyle)) 150 styles.append((desc, style, subStyle))
147 151
148 return styles 152 return styles
149 153
150 def defaultColor(self, style, substyle=-1): 154 def defaultColor(self, style, substyle=-1):
151 """ 155 """
152 Public method to get the default color of a style. 156 Public method to get the default color of a style.
153 157
154 @param style style number 158 @param style style number
155 @type int 159 @type int
156 @param substyle sub-style number 160 @param substyle sub-style number
157 @type int 161 @type int
158 @return default color 162 @return default color
159 @rtype QColor 163 @rtype QColor
160 """ 164 """
161 color = ( 165 color = (
162 self.__lex.substyleDefaultColor(style, substyle) 166 self.__lex.substyleDefaultColor(style, substyle)
163 if substyle >= 0 else 167 if substyle >= 0
164 self.__lex.defaultColor(style) 168 else self.__lex.defaultColor(style)
165 ) 169 )
166 170
167 return color 171 return color
168 172
169 def color(self, style, substyle=-1): 173 def color(self, style, substyle=-1):
170 """ 174 """
171 Public method to get the color of a style. 175 Public method to get the color of a style.
172 176
173 @param style style number 177 @param style style number
174 @type int 178 @type int
175 @param substyle sub-style number 179 @param substyle sub-style number
176 @type int 180 @type int
177 @return color 181 @return color
178 @rtype QColor 182 @rtype QColor
179 """ 183 """
180 color = ( 184 color = (
181 self.__lex.substyleColor(style, substyle) 185 self.__lex.substyleColor(style, substyle)
182 if substyle >= 0 else 186 if substyle >= 0
183 self.__lex.color(style) 187 else self.__lex.color(style)
184 ) 188 )
185 189
186 return color 190 return color
187 191
188 def setColor(self, c, style, substyle=-1): 192 def setColor(self, c, style, substyle=-1):
189 """ 193 """
190 Public method to set the color for a style. 194 Public method to set the color for a style.
191 195
192 @param c color 196 @param c color
193 @type QColor 197 @type QColor
194 @param style style number 198 @param style style number
195 @type int 199 @type int
196 @param substyle sub-style number 200 @param substyle sub-style number
198 """ 202 """
199 if substyle >= 0: 203 if substyle >= 0:
200 self.__lex.setSubstyleColor(c, style, substyle) 204 self.__lex.setSubstyleColor(c, style, substyle)
201 else: 205 else:
202 self.__lex.setColor(c, style) 206 self.__lex.setColor(c, style)
203 207
204 def defaultPaper(self, style, substyle=-1): 208 def defaultPaper(self, style, substyle=-1):
205 """ 209 """
206 Public method to get the default background for a style. 210 Public method to get the default background for a style.
207 211
208 @param style style number 212 @param style style number
209 @type int 213 @type int
210 @param substyle sub-style number 214 @param substyle sub-style number
211 @type int 215 @type int
212 @return default background color 216 @return default background color
213 @rtype QColor 217 @rtype QColor
214 """ 218 """
215 color = ( 219 color = (
216 self.__lex.substyleDefaultPaper(style, substyle) 220 self.__lex.substyleDefaultPaper(style, substyle)
217 if substyle >= 0 else 221 if substyle >= 0
218 self.__lex.defaultPaper(style) 222 else self.__lex.defaultPaper(style)
219 ) 223 )
220 224
221 return color 225 return color
222 226
223 def paper(self, style, substyle=-1): 227 def paper(self, style, substyle=-1):
224 """ 228 """
225 Public method to get the background for a style. 229 Public method to get the background for a style.
226 230
227 @param style the style number 231 @param style the style number
228 @type int 232 @type int
229 @param substyle sub-style number 233 @param substyle sub-style number
230 @type int 234 @type int
231 @return background color 235 @return background color
232 @rtype QColor 236 @rtype QColor
233 """ 237 """
234 color = ( 238 color = (
235 self.__lex.substylePaper(style, substyle) 239 self.__lex.substylePaper(style, substyle)
236 if substyle >= 0 else 240 if substyle >= 0
237 self.__lex.paper(style) 241 else self.__lex.paper(style)
238 ) 242 )
239 243
240 return color 244 return color
241 245
242 def setPaper(self, c, style, substyle=-1): 246 def setPaper(self, c, style, substyle=-1):
243 """ 247 """
244 Public method to set the background for a style. 248 Public method to set the background for a style.
245 249
246 @param c background color 250 @param c background color
247 @type QColor 251 @type QColor
248 @param style style number 252 @param style style number
249 @type int 253 @type int
250 @param substyle sub-style number 254 @param substyle sub-style number
252 """ 256 """
253 if substyle >= 0: 257 if substyle >= 0:
254 self.__lex.setSubstylePaper(c, style, substyle) 258 self.__lex.setSubstylePaper(c, style, substyle)
255 else: 259 else:
256 self.__lex.setPaper(c, style) 260 self.__lex.setPaper(c, style)
257 261
258 def defaultEolFill(self, style, substyle=-1): 262 def defaultEolFill(self, style, substyle=-1):
259 """ 263 """
260 Public method to get the default eolFill flag for a style. 264 Public method to get the default eolFill flag for a style.
261 265
262 @param style style number 266 @param style style number
263 @type int 267 @type int
264 @param substyle sub-style number 268 @param substyle sub-style number
265 @type int 269 @type int
266 @return default eolFill flag 270 @return default eolFill flag
267 @rtype bool 271 @rtype bool
268 """ 272 """
269 eolFill = ( 273 eolFill = (
270 self.__lex.substyleDefaultEolFill(style, substyle) 274 self.__lex.substyleDefaultEolFill(style, substyle)
271 if substyle >= 0 else 275 if substyle >= 0
272 self.__lex.defaultEolFill(style) 276 else self.__lex.defaultEolFill(style)
273 ) 277 )
274 278
275 return eolFill 279 return eolFill
276 280
277 def eolFill(self, style, substyle=-1): 281 def eolFill(self, style, substyle=-1):
278 """ 282 """
279 Public method to get the eolFill flag for a style. 283 Public method to get the eolFill flag for a style.
280 284
281 @param style style number 285 @param style style number
282 @type int 286 @type int
283 @param substyle sub-style number 287 @param substyle sub-style number
284 @type int 288 @type int
285 @return eolFill flag 289 @return eolFill flag
286 @rtype bool 290 @rtype bool
287 """ 291 """
288 eolFill = ( 292 eolFill = (
289 self.__lex.substyleEolFill(style, substyle) 293 self.__lex.substyleEolFill(style, substyle)
290 if substyle >= 0 else 294 if substyle >= 0
291 self.__lex.eolFill(style) 295 else self.__lex.eolFill(style)
292 ) 296 )
293 297
294 return eolFill 298 return eolFill
295 299
296 def setEolFill(self, eolfill, style, substyle=-1): 300 def setEolFill(self, eolfill, style, substyle=-1):
297 """ 301 """
298 Public method to set the eolFill flag for a style. 302 Public method to set the eolFill flag for a style.
299 303
300 @param eolfill eolFill flag 304 @param eolfill eolFill flag
301 @type bool 305 @type bool
302 @param style style number 306 @param style style number
303 @type int 307 @type int
304 @param substyle sub-style number 308 @param substyle sub-style number
306 """ 310 """
307 if substyle >= 0: 311 if substyle >= 0:
308 self.__lex.setSubstyleEolFill(eolfill, style, substyle) 312 self.__lex.setSubstyleEolFill(eolfill, style, substyle)
309 else: 313 else:
310 self.__lex.setEolFill(eolfill, style) 314 self.__lex.setEolFill(eolfill, style)
311 315
312 def defaultFont(self, style, substyle=-1): 316 def defaultFont(self, style, substyle=-1):
313 """ 317 """
314 Public method to get the default font for a style. 318 Public method to get the default font for a style.
315 319
316 @param style style number 320 @param style style number
317 @type int 321 @type int
318 @param substyle sub-style number 322 @param substyle sub-style number
319 @type int 323 @type int
320 @return default font 324 @return default font
321 @rtype QFont 325 @rtype QFont
322 """ 326 """
323 font = ( 327 font = (
324 self.__lex.substyleDefaultFont(style, substyle) 328 self.__lex.substyleDefaultFont(style, substyle)
325 if substyle >= 0 else 329 if substyle >= 0
326 self.__lex.defaultFont(style) 330 else self.__lex.defaultFont(style)
327 ) 331 )
328 332
329 return font 333 return font
330 334
331 def font(self, style, substyle=-1): 335 def font(self, style, substyle=-1):
332 """ 336 """
333 Public method to get the font for a style. 337 Public method to get the font for a style.
334 338
335 @param style style number 339 @param style style number
336 @type int 340 @type int
337 @param substyle sub-style number 341 @param substyle sub-style number
338 @type int 342 @type int
339 @return font 343 @return font
340 @rtype QFont 344 @rtype QFont
341 """ 345 """
342 font = ( 346 font = (
343 self.__lex.substyleFont(style, substyle) 347 self.__lex.substyleFont(style, substyle)
344 if substyle >= 0 else 348 if substyle >= 0
345 self.__lex.font(style) 349 else self.__lex.font(style)
346 ) 350 )
347 351
348 return font 352 return font
349 353
350 def setFont(self, f, style, substyle=-1): 354 def setFont(self, f, style, substyle=-1):
351 """ 355 """
352 Public method to set the font for a style. 356 Public method to set the font for a style.
353 357
354 @param f font 358 @param f font
355 @type QFont 359 @type QFont
356 @param style style number 360 @param style style number
357 @type int 361 @type int
358 @param substyle sub-style number 362 @param substyle sub-style number
360 """ 364 """
361 if substyle >= 0: 365 if substyle >= 0:
362 self.__lex.setSubstyleFont(f, style, substyle) 366 self.__lex.setSubstyleFont(f, style, substyle)
363 else: 367 else:
364 self.__lex.setFont(f, style) 368 self.__lex.setFont(f, style)
365 369
366 def defaultWords(self, style, substyle=-1): 370 def defaultWords(self, style, substyle=-1):
367 """ 371 """
368 Public method to get the default list of words for a style. 372 Public method to get the default list of words for a style.
369 373
370 @param style style number 374 @param style style number
371 @type int 375 @type int
372 @param substyle sub-style number 376 @param substyle sub-style number
373 @type int 377 @type int
374 @return whitespace separated default list of words 378 @return whitespace separated default list of words
375 @rtype str 379 @rtype str
376 """ 380 """
377 words = ( 381 words = (
378 self.__lex.substyleDefaultWords(style, substyle) 382 self.__lex.substyleDefaultWords(style, substyle) if substyle >= 0 else ""
379 if substyle >= 0 else 383 )
380 "" 384
381 )
382
383 return words 385 return words
384 386
385 def words(self, style, substyle=-1): 387 def words(self, style, substyle=-1):
386 """ 388 """
387 Public method to get the list of words for a style. 389 Public method to get the list of words for a style.
388 390
389 @param style style number 391 @param style style number
390 @type int 392 @type int
391 @param substyle sub-style number 393 @param substyle sub-style number
392 @type int 394 @type int
393 @return whitespace separated list of words 395 @return whitespace separated list of words
394 @rtype str 396 @rtype str
395 """ 397 """
396 words = (self.__lex.substyleWords(style, substyle) if substyle >= 0 398 words = self.__lex.substyleWords(style, substyle) if substyle >= 0 else ""
397 else "") 399
398
399 return words 400 return words
400 401
401 def setWords(self, words, style, substyle=-1): 402 def setWords(self, words, style, substyle=-1):
402 """ 403 """
403 Public method to set the list of words for a style. 404 Public method to set the list of words for a style.
404 405
405 @param words whitespace separated list of words 406 @param words whitespace separated list of words
406 @type str 407 @type str
407 @param style style number 408 @param style style number
408 @type int 409 @type int
409 @param substyle sub-style number 410 @param substyle sub-style number
410 @type int 411 @type int
411 """ 412 """
412 if substyle >= 0: 413 if substyle >= 0:
413 # only supported for sub-styles 414 # only supported for sub-styles
414 self.__lex.setSubstyleWords(words, style, substyle) 415 self.__lex.setSubstyleWords(words, style, substyle)
415 416
416 def defaultDescription(self, style, substyle=-1): 417 def defaultDescription(self, style, substyle=-1):
417 """ 418 """
418 Public method to get the default descriptive string for a style. 419 Public method to get the default descriptive string for a style.
419 420
420 @param style style number 421 @param style style number
421 @type int 422 @type int
422 @param substyle sub-style number 423 @param substyle sub-style number
423 @type int 424 @type int
424 @return default description of the style 425 @return default description of the style
425 @rtype str 426 @rtype str
426 """ 427 """
427 desc = ( 428 desc = (
428 self.__lex.substyleDefaultDescription(style, substyle) 429 self.__lex.substyleDefaultDescription(style, substyle)
429 if substyle >= 0 else 430 if substyle >= 0
431 else
430 # for base styles return the hard coded description 432 # for base styles return the hard coded description
431 self.__lex.description(style) 433 self.__lex.description(style)
432 ) 434 )
433 435
434 return desc 436 return desc
435 437
436 def description(self, style, substyle=-1): 438 def description(self, style, substyle=-1):
437 """ 439 """
438 Public method to get a descriptive string for a style. 440 Public method to get a descriptive string for a style.
439 441
440 @param style style number 442 @param style style number
441 @type int 443 @type int
442 @param substyle sub-style number 444 @param substyle sub-style number
443 @type int 445 @type int
444 @return description of the style 446 @return description of the style
445 @rtype str 447 @rtype str
446 """ 448 """
447 desc = ( 449 desc = (
448 self.__lex.substyleDescription(style, substyle) 450 self.__lex.substyleDescription(style, substyle)
449 if substyle >= 0 else 451 if substyle >= 0
450 self.__lex.description(style) 452 else self.__lex.description(style)
451 ) 453 )
452 454
453 return desc 455 return desc
454 456
455 def setDescription(self, description, style, substyle=-1): 457 def setDescription(self, description, style, substyle=-1):
456 """ 458 """
457 Public method to set a descriptive string for a style. 459 Public method to set a descriptive string for a style.
458 460
459 @param description description for the style 461 @param description description for the style
460 @type str 462 @type str
461 @param style style number 463 @param style style number
462 @type int 464 @type int
463 @param substyle sub-style number 465 @param substyle sub-style number
464 @type int 466 @type int
465 """ 467 """
466 if substyle >= 0: 468 if substyle >= 0:
467 # only supported for sub-styles 469 # only supported for sub-styles
468 self.__lex.setSubstyleDescription(description, style, substyle) 470 self.__lex.setSubstyleDescription(description, style, substyle)
469 471
470 def language(self): 472 def language(self):
471 """ 473 """
472 Public method to get the lexers programming language. 474 Public method to get the lexers programming language.
473 475
474 @return lexer programming language 476 @return lexer programming language
475 @rtype str 477 @rtype str
476 """ 478 """
477 return self.__lex.language() 479 return self.__lex.language()
478 480
479 def hasStyle(self, style, substyle): 481 def hasStyle(self, style, substyle):
480 """ 482 """
481 Public method to test for a given style definition. 483 Public method to test for a given style definition.
482 484
483 @param style style number 485 @param style style number
484 @type int 486 @type int
485 @param substyle sub-style number 487 @param substyle sub-style number
486 @type int 488 @type int
487 @return flag indicating the existence of a style definition 489 @return flag indicating the existence of a style definition
488 @rtype bool 490 @rtype bool
489 """ 491 """
490 ok = (self.__lex.hasSubstyle(style, substyle) if substyle >= 0 492 ok = self.__lex.hasSubstyle(style, substyle) if substyle >= 0 else True
491 else True) 493
492
493 return ok 494 return ok
494 495
495 def isBaseStyle(self, style): 496 def isBaseStyle(self, style):
496 """ 497 """
497 Public method to test, if a given style may have sub-styles. 498 Public method to test, if a given style may have sub-styles.
498 499
499 @param style base style number 500 @param style base style number
500 @type int 501 @type int
501 @return flag indicating that the style may have sub-styles 502 @return flag indicating that the style may have sub-styles
502 @rtype bool 503 @rtype bool
503 """ 504 """
504 return self.__lex.hasSubstyles() and self.__lex.isBaseStyle(style) 505 return self.__lex.hasSubstyles() and self.__lex.isBaseStyle(style)
505 506
506 def addSubstyle(self, style): 507 def addSubstyle(self, style):
507 """ 508 """
508 Public method to add an empty sub-style to a given style. 509 Public method to add an empty sub-style to a given style.
509 510
510 @param style style number 511 @param style style number
511 @type int 512 @type int
512 @return allocated sub-style number or -1 to indicate an error 513 @return allocated sub-style number or -1 to indicate an error
513 @rtype int 514 @rtype int
514 """ 515 """
515 return self.__lex.addSubstyle(style) 516 return self.__lex.addSubstyle(style)
516 517
517 def delSubstyle(self, style, substyle): 518 def delSubstyle(self, style, substyle):
518 """ 519 """
519 Public method to delete a given sub-style definition. 520 Public method to delete a given sub-style definition.
520 521
521 @param style base style number 522 @param style base style number
522 @type int 523 @type int
523 @param substyle sub-style number 524 @param substyle sub-style number
524 @type int 525 @type int
525 @return flag indicating successful deletion 526 @return flag indicating successful deletion
526 @rtype bool 527 @rtype bool
527 """ 528 """
528 return self.__lex.delSubstyle(style, substyle) 529 return self.__lex.delSubstyle(style, substyle)
529 530
530 def loadDefaultSubStyles(self, style): 531 def loadDefaultSubStyles(self, style):
531 """ 532 """
532 Public method to load the default sub-styles for a given base style. 533 Public method to load the default sub-styles for a given base style.
533 534
534 @param style style number 535 @param style style number
535 @type int 536 @type int
536 """ 537 """
537 self.__lex.loadDefaultSubStyles(style) 538 self.__lex.loadDefaultSubStyles(style)

eric ide

mercurial