eric6/QScintilla/Lexers/__init__.py

changeset 7900
72b88fb20261
parent 7781
607a6098cb44
child 7923
91e843545d9a
equal deleted inserted replaced
7899:ecf67e07b6e0 7900:72b88fb20261
36 @param displayString display string (string) 36 @param displayString display string (string)
37 @param filenameSample dummy filename to derive lexer name (string) 37 @param filenameSample dummy filename to derive lexer name (string)
38 @param getLexerFunc reference to a function instantiating the specific 38 @param getLexerFunc reference to a function instantiating the specific
39 lexer. This function must take a reference to the parent as its only 39 lexer. This function must take a reference to the parent as its only
40 argument. 40 argument.
41 @keyparam openFilters list of open file filters (list of strings) 41 @param openFilters list of open file filters (list of strings)
42 @keyparam saveFilters list of save file filters (list of strings) 42 @param saveFilters list of save file filters (list of strings)
43 @keyparam defaultAssocs default lexer associations (list of strings of 43 @param defaultAssocs default lexer associations (list of strings of
44 filename wildcard patterns to be associated with the lexer) 44 filename wildcard patterns to be associated with the lexer)
45 @keyparam iconFileName name of an icon file (string) 45 @param iconFileName name of an icon file (string)
46 @exception KeyError raised when the given name is already in use 46 @exception KeyError raised when the given name is already in use
47 """ 47 """
48 global LexerRegistry 48 global LexerRegistry
49 if name in LexerRegistry: 49 if name in LexerRegistry:
50 raise KeyError('Lexer "{0}" already registered.'.format(name)) 50 raise KeyError('Lexer "{0}" already registered.'.format(name))
211 """ 211 """
212 Module function to instantiate a lexer object for a given language. 212 Module function to instantiate a lexer object for a given language.
213 213
214 @param language language of the lexer (string) 214 @param language language of the lexer (string)
215 @param parent reference to the parent object (QObject) 215 @param parent reference to the parent object (QObject)
216 @keyparam pyname name of the pygments lexer to use (string) 216 @param pyname name of the pygments lexer to use (string)
217 @return reference to the instanciated lexer object (QsciLexer) 217 @return reference to the instanciated lexer object (QsciLexer)
218 """ 218 """
219 if not pyname: 219 if not pyname:
220 try: 220 try:
221 if language in ["Python", "Python3", "Cython", "MicroPython"]: 221 if language in ["Python", "Python3", "Cython", "MicroPython"]:
346 def __getPygmentsLexer(parent, name=""): 346 def __getPygmentsLexer(parent, name=""):
347 """ 347 """
348 Private module function to instantiate a pygments lexer. 348 Private module function to instantiate a pygments lexer.
349 349
350 @param parent reference to the parent widget 350 @param parent reference to the parent widget
351 @keyparam name name of the pygments lexer to use (string) 351 @param name name of the pygments lexer to use (string)
352 @return reference to the lexer (LexerPygments) or None 352 @return reference to the lexer (LexerPygments) or None
353 """ 353 """
354 from .LexerPygments import LexerPygments 354 from .LexerPygments import LexerPygments
355 lexer = LexerPygments(parent, name=name) 355 lexer = LexerPygments(parent, name=name)
356 if lexer.canStyle(): 356 if lexer.canStyle():
366 366
367 @param includeAll flag indicating the inclusion of the 367 @param includeAll flag indicating the inclusion of the
368 All Files filter (boolean) 368 All Files filter (boolean)
369 @param asString flag indicating the list should be returned 369 @param asString flag indicating the list should be returned
370 as a string (boolean) 370 as a string (boolean)
371 @keyparam withAdditional flag indicating to include additional filters 371 @param withAdditional flag indicating to include additional filters
372 defined by the user (boolean) 372 defined by the user (boolean)
373 @return file filter list (list of strings or string) 373 @return file filter list (list of strings or string)
374 """ 374 """
375 openFileFiltersList = [ 375 openFileFiltersList = [
376 QCoreApplication.translate( 376 QCoreApplication.translate(
536 536
537 @param includeAll flag indicating the inclusion of the 537 @param includeAll flag indicating the inclusion of the
538 All Files filter (boolean) 538 All Files filter (boolean)
539 @param asString flag indicating the list should be returned 539 @param asString flag indicating the list should be returned
540 as a string (boolean) 540 as a string (boolean)
541 @keyparam withAdditional flag indicating to include additional filters 541 @param withAdditional flag indicating to include additional filters
542 defined by the user (boolean) 542 defined by the user (boolean)
543 @return file filter list (list of strings or string) 543 @return file filter list (list of strings or string)
544 """ 544 """
545 saveFileFiltersList = [ 545 saveFileFiltersList = [
546 QCoreApplication.translate( 546 QCoreApplication.translate(

eric ide

mercurial