src/eric7/QScintilla/Lexers/__init__.py

Tue, 06 May 2025 15:32:29 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 06 May 2025 15:32:29 +0200
branch
eric7
changeset 11270
0e220c26e60e
parent 11090
f5f5f5803935
permissions
-rw-r--r--

Various changes and optimizations to the MicroPython support.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
11090
f5f5f5803935 Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10682
diff changeset
3 # Copyright (c) 2007 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Package implementing lexers for the various supported programming languages.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
9599
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
10 import contextlib
9484
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
11 import importlib
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
12
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
13 from PyQt6.QtCore import QCoreApplication
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
15 from eric7 import Preferences
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
16 from eric7.EricGui import EricPixmapCache
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 # The lexer registry
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 # Dictionary with the language name as key. Each entry is a list with
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 # 0. display string (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 # 1. dummy filename to derive lexer name (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 # 2. reference to a function instantiating the specific lexer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 # This function must take a reference to the parent as argument.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 # 3. list of open file filters (list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 # 4. list of save file filters (list of strings)
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
26 # 5. default lexer associations (list of strings of filename wildcard
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
27 # patterns to be associated with the lexer)
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
28 # 6. name of an icon file (string)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 LexerRegistry = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
31
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
32 def registerLexer(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
33 name,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
34 displayString,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
35 filenameSample,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
36 getLexerFunc,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
37 openFilters=None,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
38 saveFilters=None,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
39 defaultAssocs=None,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
40 iconFileName="",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
41 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 Module function to register a custom QScintilla lexer.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
44
9599
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
45 @param name lexer language name
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
46 @type str
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
47 @param displayString display string
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
48 @type str
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
49 @param filenameSample dummy filename to derive lexer name
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
50 @type str
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
51 @param getLexerFunc reference to a function instantiating the specific
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
52 lexer. This function must take a reference to the parent as its only
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
53 argument.
9599
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
54 @type function
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
55 @param openFilters list of open file filters
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
56 @type list of str
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
57 @param saveFilters list of save file filters
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
58 @type list of str
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
59 @param defaultAssocs default lexer associations (list of filename wildcard
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
60 patterns to be associated with the lexer)
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
61 @type list of str
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
62 @param iconFileName name of an icon file
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
63 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 @exception KeyError raised when the given name is already in use
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 """
97
c4086afea02b Finished cleaning up the code supported by py3flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 40
diff changeset
66 global LexerRegistry
9612
93b496cc3c88 Class Browsers
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9609
diff changeset
67
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 if name in LexerRegistry:
428
58405c24aa09 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
69 raise KeyError('Lexer "{0}" already registered.'.format(name))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 else:
5651
982465f8389c Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5423
diff changeset
71 LexerRegistry[name] = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
72 displayString,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
73 filenameSample,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
74 getLexerFunc,
5651
982465f8389c Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5423
diff changeset
75 [] if openFilters is None else openFilters[:],
982465f8389c Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5423
diff changeset
76 [] if saveFilters is None else saveFilters[:],
982465f8389c Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5423
diff changeset
77 [] if defaultAssocs is None else defaultAssocs[:],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
78 iconFileName,
5651
982465f8389c Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5423
diff changeset
79 ]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
9599
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
81 textFilePatterns = Preferences.getUI("TextFilePatterns")
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
82 textFilePatterns.extend([p for p in defaultAssocs if p not in textFilePatterns])
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
83 Preferences.setUI("TextFilePatterns", textFilePatterns)
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
84
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
85
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 def unregisterLexer(name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 Module function to unregister a custom QScintilla lexer.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
89
9599
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
90 @param name lexer language name
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
91 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 """
9612
93b496cc3c88 Class Browsers
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9609
diff changeset
93 global LexerRegistry
93b496cc3c88 Class Browsers
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9609
diff changeset
94
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 if name in LexerRegistry:
9599
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
96 textFilePatterns = Preferences.getUI("TextFilePatterns")
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
97 for pat in LexerRegistry[name][5]:
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
98 with contextlib.suppress(ValueError):
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
99 textFilePatterns.remove(pat)
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
100 Preferences.setUI("TextFilePatterns", textFilePatterns)
dc0666634751 Changed the lexer registration and unregistration code to also add/remove the file patterns to/from the list of known text file patterns.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9563
diff changeset
101
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 del LexerRegistry[name]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
104
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 def getSupportedLanguages():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 Module function to get a dictionary of supported lexer languages.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
108
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 @return dictionary of supported lexer languages. The keys are the
3556
40e205ef1470 Corrected a source docu error in the lexers package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
110 internal language names. The items are lists of three entries.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 The first is the display string for the language, the second
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
112 is a dummy file name, which can be used to derive the lexer, and
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
113 the third is the name of an icon file.
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
114 @rtype dict of {str: [str, str, str]}
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 supportedLanguages = {
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
117 "Bash": [QCoreApplication.translate("Lexers", "Bash"), "dummy.sh", "lexerBash"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
118 "Batch": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
119 QCoreApplication.translate("Lexers", "Batch"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
120 "dummy.bat",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
121 "lexerBatch",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
122 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
123 "C++": [QCoreApplication.translate("Lexers", "C/C++"), "dummy.cpp", "lexerCPP"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
124 "C#": [QCoreApplication.translate("Lexers", "C#"), "dummy.cs", "lexerCsharp"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
125 "CMake": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
126 QCoreApplication.translate("Lexers", "CMake"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
127 "dummy.cmake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
128 "lexerCMake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
129 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
130 "CSS": [QCoreApplication.translate("Lexers", "CSS"), "dummy.css", "lexerCSS"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
131 "Cython": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
132 QCoreApplication.translate("Lexers", "Cython"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
133 "dummy.pyx",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
134 "lexerCython",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
135 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
136 "D": [QCoreApplication.translate("Lexers", "D"), "dummy.d", "lexerD"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
137 "Diff": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
138 QCoreApplication.translate("Lexers", "Diff"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
139 "dummy.diff",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
140 "lexerDiff",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
141 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
142 "Fortran": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
143 QCoreApplication.translate("Lexers", "Fortran"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
144 "dummy.f95",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
145 "lexerFortran",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
146 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
147 "Fortran77": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
148 QCoreApplication.translate("Lexers", "Fortran77"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
149 "dummy.f",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
150 "lexerFortran",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
151 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
152 "HTML": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
153 QCoreApplication.translate("Lexers", "HTML/PHP/XML"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
154 "dummy.html",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
155 "lexerHTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
157 "Java": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
158 QCoreApplication.translate("Lexers", "Java"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
159 "dummy.java",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
160 "lexerJava",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
161 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
162 "JavaScript": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
163 QCoreApplication.translate("Lexers", "JavaScript"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
164 "dummy.js",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
165 "lexerJavaScript",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
166 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
167 "Lua": [QCoreApplication.translate("Lexers", "Lua"), "dummy.lua", "lexerLua"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
168 "Makefile": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
169 QCoreApplication.translate("Lexers", "Makefile"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 "dummy.mak",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
171 "lexerMakefile",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
172 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
173 "Matlab": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
174 QCoreApplication.translate("Lexers", "Matlab"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
175 "dummy.m.matlab",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
176 "lexerMatlab",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
177 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
178 "Octave": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
179 QCoreApplication.translate("Lexers", "Octave"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
180 "dummy.m.octave",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
181 "lexerOctave",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
182 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
183 "Pascal": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
184 QCoreApplication.translate("Lexers", "Pascal"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
185 "dummy.pas",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
186 "lexerPascal",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
187 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
188 "Perl": [QCoreApplication.translate("Lexers", "Perl"), "dummy.pl", "lexerPerl"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
189 "PostScript": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
190 QCoreApplication.translate("Lexers", "PostScript"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
191 "dummy.ps",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
192 "lexerPostscript",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
193 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
194 "Povray": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
195 QCoreApplication.translate("Lexers", "Povray"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
196 "dummy.pov",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
197 "lexerPOV",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
198 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
199 "Properties": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
200 QCoreApplication.translate("Lexers", "Properties"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
201 "dummy.ini",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
202 "lexerProperties",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
203 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
204 "Python3": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
205 QCoreApplication.translate("Lexers", "Python3"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
206 "dummy.py",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
207 "lexerPython3",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
208 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
209 "MicroPython": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
210 QCoreApplication.translate("Lexers", "MicroPython"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
211 "dummy.py",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
212 "micropython",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
213 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
214 "QSS": [QCoreApplication.translate("Lexers", "QSS"), "dummy.qss", "lexerCSS"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
215 "Ruby": [QCoreApplication.translate("Lexers", "Ruby"), "dummy.rb", "lexerRuby"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
216 "SQL": [QCoreApplication.translate("Lexers", "SQL"), "dummy.sql", "lexerSQL"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
217 "TCL": [QCoreApplication.translate("Lexers", "TCL"), "dummy.tcl", "lexerTCL"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
218 "TeX": [QCoreApplication.translate("Lexers", "TeX"), "dummy.tex", "lexerTeX"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
219 "VHDL": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
220 QCoreApplication.translate("Lexers", "VHDL"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
221 "dummy.vhd",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
222 "lexerVHDL",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
223 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
224 "XML": [QCoreApplication.translate("Lexers", "XML"), "dummy.xml", "lexerXML"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
225 "YAML": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
226 QCoreApplication.translate("Lexers", "YAML"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
227 "dummy.yml",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
228 "lexerYAML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
229 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
230 "Gettext": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
231 QCoreApplication.translate("Lexers", "Gettext"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
232 "dummy.po",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
233 "lexerGettext",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
235 "CoffeeScript": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
236 QCoreApplication.translate("Lexers", "CoffeeScript"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
237 "dummy.coffee",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
238 "lexerCoffeeScript",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
239 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
240 "JSON": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
241 QCoreApplication.translate("Lexers", "JSON"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
242 "dummy.json",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
243 "lexerJSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
244 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
245 "Markdown": [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
246 QCoreApplication.translate("Lexers", "Markdown"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
247 "dummy.md",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
248 "lexerMarkdown",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
249 ],
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 }
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
251
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 for name in LexerRegistry:
3105
80850df745a3 Fixed a little nuisance in the QScintilla lexer interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3030
diff changeset
253 if not name.startswith("Pygments|"):
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
254 supportedLanguages[name] = LexerRegistry[name][:2] + [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
255 LexerRegistry[name][6]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
256 ]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
257
7267
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
258 supportedLanguages["Guessed"] = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
259 QCoreApplication.translate("Lexers", "Pygments"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260 "dummy.pygments",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
261 "",
7267
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
262 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
263
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 return supportedLanguages
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
266
5358
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
267 def getSupportedApiLanguages():
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
268 """
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
269 Module function to get a list of supported API languages.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
270
5358
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
271 @return list of supported API languages
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
272 @rtype list of str
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
273 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
274 return [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
275 lang
10373
093dcebe5ecb Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
276 for lang in getSupportedLanguages()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
277 if lang != "Guessed" and not lang.startswith("Pygments|")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
278 ]
5358
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
279
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5068
diff changeset
280
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
281 def getLanguageIcon(language, pixmap):
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
282 """
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
283 Module function to get an icon for a language.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
284
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
285 @param language language of the lexer
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
286 @type str
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
287 @param pixmap flag indicating to return a pixmap
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
288 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
289 @return icon for the language
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
290 @rtype QPixmap or QIcon
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
291 """
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
292 supportedLanguages = getSupportedLanguages()
8259
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8027
diff changeset
293 iconFileName = (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
294 supportedLanguages[language][2] if language in supportedLanguages else ""
8259
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8027
diff changeset
295 )
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
296 if pixmap:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
297 return EricPixmapCache.getPixmap(iconFileName)
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
298 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
299 return EricPixmapCache.getIcon(iconFileName)
2217
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
300
e80c74f2a25a Added some icons to the "Languages" and "End-of-Line Type" context menus of the editor and changed the status labels for programming language and end-of-line type of the main window to show an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
301
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
302 def getLexer(language, parent=None, pyname=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 Module function to instantiate a lexer object for a given language.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
305
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
306 @param language language of the lexer
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
307 @type str
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
308 @param parent reference to the parent object
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
309 @type QObject
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
310 @param pyname name of the pygments lexer to use
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
311 @type str
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
312 @return reference to the instantiated lexer object
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
313 @rtype QsciLexer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 if not pyname:
9484
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
316 languageLexerMapping = {
9497
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
317 "Bash": ".LexerBash",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
318 "Batch": ".LexerBatch",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
319 "C#": ".LexerCSharp",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
320 "C++": ".LexerCPP",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
321 "CMake": ".LexerCMake",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
322 "CoffeeScript": ".LexerCoffeeScript",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
323 "CSS": ".LexerCSS",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
324 "Cython": ".LexerPython",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
325 "D": ".LexerD",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
326 "Diff": ".LexerDiff",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
327 "Fortran": ".LexerFortran",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
328 "Fortran77": ".LexerFortran77",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
329 "Gettext": ".LexerPO",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
330 "HTML": ".LexerHTML",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
331 "Java": ".LexerJava",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
332 "JavaScript": ".LexerJavaScript",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
333 "JSON": ".LexerJSON",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
334 "Lua": ".LexerLua",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
335 "Makefile": ".LexerMakefile",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
336 "Markdown": ".LexerMarkdown",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
337 "Matlab": ".LexerMatlab",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
338 "MicroPython": ".LexerPython",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
339 "Octave": ".LexerOctave",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
340 "Pascal": ".LexerPascal",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
341 "Perl": ".LexerPerl",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
342 "PostScript": ".LexerPostScript",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
343 "Properties": ".LexerProperties",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
344 "Povray": ".LexerPOV",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
345 "Python": ".LexerPython",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
346 "Python3": ".LexerPython",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
347 "QSS": ".LexerQSS",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
348 "Ruby": ".LexerRuby",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
349 "SQL": ".LexerSQL",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
350 "TCL": ".LexerTCL",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
351 "TeX": ".LexerTeX",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
352 "VHDL": ".LexerVHDL",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
353 "XML": ".LexerXML",
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
354 "YAML": ".LexerYAML",
9484
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
355 }
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 try:
9484
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
357 if language in languageLexerMapping:
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
358 mod = importlib.import_module(
9497
8beca4047c53 Modified most of the importlib.import_module() calls to use relative imports.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9484
diff changeset
359 languageLexerMapping[language], __package__
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
360 )
9484
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
361 if mod:
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
362 return mod.createLexer(language, parent)
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
363 else:
d2eb8f0a5bf0 Changed the way editor lexers are instantiated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
364 return __getPygmentsLexer(parent)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
365
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 elif language in LexerRegistry:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 return LexerRegistry[language][2](parent)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
368
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 return __getPygmentsLexer(parent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 except ImportError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 return __getPygmentsLexer(parent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 else:
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
374 return __getPygmentsLexer(parent, name=pyname)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
376
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
377 def __getPygmentsLexer(parent, name=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 Private module function to instantiate a pygments lexer.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
380
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 @param parent reference to the parent widget
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
382 @type QWidget
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
383 @param name name of the pygments lexer to use
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
384 @type str
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
385 @return reference to the lexer or None
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
386 @rtype LexerPygments
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
388 from .LexerPygments import LexerPygments
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
389
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
390 lexer = LexerPygments(parent, name=name)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 if lexer.canStyle():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 return lexer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 return None
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
395
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
396
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
397 def getOpenFileFiltersList(includeAll=False, asString=False, withAdditional=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 Module function to get the file filter list for an open file operation.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
400
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
401 @param includeAll flag indicating the inclusion of the "All Files" filter
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
402 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
403 @param asString flag indicating the list should be returned as a string
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
404 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
405 @param withAdditional flag indicating to include additional filters defined
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
406 by the user
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
407 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
408 @return file filter list
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
409 @rtype list of str or str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 openFileFiltersList = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
412 QCoreApplication.translate("Lexers", "Python Files (*.py *.py3)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
413 QCoreApplication.translate("Lexers", "Python GUI Files (*.pyw *.pyw3)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
414 QCoreApplication.translate("Lexers", "Cython Files (*.pyx *.pxd *.pxi)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
415 QCoreApplication.translate("Lexers", "Quixote Template Files (*.ptl)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
416 QCoreApplication.translate("Lexers", "Ruby Files (*.rb)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
417 QCoreApplication.translate("Lexers", "C Files (*.h *.c)"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3647
diff changeset
418 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
419 "Lexers", "C++ Files (*.h *.hpp *.hh *.cxx *.cpp *.cc)"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
420 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
421 QCoreApplication.translate("Lexers", "C# Files (*.cs)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
422 QCoreApplication.translate("Lexers", "HTML Files (*.html *.htm *.asp *.shtml)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
423 QCoreApplication.translate("Lexers", "CSS Files (*.css)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
424 QCoreApplication.translate("Lexers", "QSS Files (*.qss)"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3647
diff changeset
425 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
426 "Lexers", "PHP Files (*.php *.php3 *.php4 *.php5 *.phtml)"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
427 ),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3647
diff changeset
428 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
429 "Lexers", "XML Files (*.xml *.xsl *.xslt *.dtd *.svg *.xul *.xsd)"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
430 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
431 QCoreApplication.translate("Lexers", "Qt Resource Files (*.qrc)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
432 QCoreApplication.translate("Lexers", "D Files (*.d *.di)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
433 QCoreApplication.translate("Lexers", "Java Files (*.java)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
434 QCoreApplication.translate("Lexers", "JavaScript Files (*.js)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
435 QCoreApplication.translate("Lexers", "SQL Files (*.sql)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
436 QCoreApplication.translate("Lexers", "Docbook Files (*.docbook)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
437 QCoreApplication.translate("Lexers", "Perl Files (*.pl *.pm *.ph)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
438 QCoreApplication.translate("Lexers", "Lua Files (*.lua)"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3647
diff changeset
439 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
440 "Lexers", "Tex Files (*.tex *.sty *.aux *.toc *.idx)"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
441 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
442 QCoreApplication.translate("Lexers", "Shell Files (*.sh)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
443 QCoreApplication.translate("Lexers", "Batch Files (*.bat *.cmd)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
444 QCoreApplication.translate("Lexers", "Diff Files (*.diff *.patch)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
445 QCoreApplication.translate("Lexers", "Makefiles (*makefile Makefile *.mak)"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3647
diff changeset
446 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
447 "Lexers",
9563
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9497
diff changeset
448 "Properties Files (*.properties *.ini *.inf *.reg *.cfg *.cnf *.rc)",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
449 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
450 QCoreApplication.translate("Lexers", "Povray Files (*.pov)"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3647
diff changeset
451 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
452 "Lexers", "CMake Files (CMakeLists.txt *.cmake *.ctest)"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
453 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
454 QCoreApplication.translate("Lexers", "VHDL Files (*.vhd *.vhdl)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
455 QCoreApplication.translate("Lexers", "TCL/Tk Files (*.tcl *.tk)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
456 QCoreApplication.translate("Lexers", "Fortran Files (*.f90 *.f95 *.f2k)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
457 QCoreApplication.translate("Lexers", "Fortran77 Files (*.f *.for)"),
7743
817a81a2e6aa Editor: added support for TOML files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7637
diff changeset
458 QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
459 "Lexers", "Pascal Files (*.dpr *.dpk *.pas *.dfm *.inc *.pp)"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
460 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
461 QCoreApplication.translate("Lexers", "PostScript Files (*.ps)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
462 QCoreApplication.translate("Lexers", "YAML Files (*.yaml *.yml)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
463 QCoreApplication.translate("Lexers", "TOML Files (*.toml)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
464 QCoreApplication.translate("Lexers", "Matlab Files (*.m *.m.matlab)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
465 QCoreApplication.translate("Lexers", "Octave Files (*.m *.m.octave)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
466 QCoreApplication.translate("Lexers", "Gettext Files (*.po)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
467 QCoreApplication.translate("Lexers", "CoffeeScript Files (*.coffee)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
468 QCoreApplication.translate("Lexers", "JSON Files (*.json)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
469 QCoreApplication.translate("Lexers", "Markdown Files (*.md)"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
471
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 for name in LexerRegistry:
2710
8c91d494ad06 Fixed a serious issues in the Lexer.__init__.py module causing a traceback after a plug-in supplying several file filters was activated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
473 openFileFiltersList.extend(LexerRegistry[name][3])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
474
740
9625b5817d1c Started to implement user defined file filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 428
diff changeset
475 if withAdditional:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
476 openFileFiltersList.extend(Preferences.getEditor("AdditionalOpenFilters"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
477
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 openFileFiltersList.sort()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 if includeAll:
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
480 openFileFiltersList.append(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
481 QCoreApplication.translate("Lexers", "All Files (*)")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
482 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
483
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 if asString:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
485 return ";;".join(openFileFiltersList)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487 return openFileFiltersList
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
489
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
490 def getSaveFileFiltersList(includeAll=False, asString=False, withAdditional=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 Module function to get the file filter list for a save file operation.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
493
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
494 @param includeAll flag indicating the inclusion of the "All Files" filter
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
495 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
496 @param asString flag indicating the list should be returned as a string
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
497 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
498 @param withAdditional flag indicating to include additional filters defined
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
499 by the user
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
500 @type bool
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
501 @return file filter list
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
502 @rtype list of str or str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 saveFileFiltersList = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
505 QCoreApplication.translate("Lexers", "Python3 Files (*.py)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
506 QCoreApplication.translate("Lexers", "Python3 GUI Files (*.pyw)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
507 QCoreApplication.translate("Lexers", "Cython Files (*.pyx)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
508 QCoreApplication.translate("Lexers", "Cython Declaration Files (*.pxd)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
509 QCoreApplication.translate("Lexers", "Cython Include Files (*.pxi)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
510 QCoreApplication.translate("Lexers", "Quixote Template Files (*.ptl)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
511 QCoreApplication.translate("Lexers", "Ruby Files (*.rb)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
512 QCoreApplication.translate("Lexers", "C Files (*.c)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
513 QCoreApplication.translate("Lexers", "C++ Files (*.cpp)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
514 QCoreApplication.translate("Lexers", "C++/C Header Files (*.h)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
515 QCoreApplication.translate("Lexers", "C# Files (*.cs)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
516 QCoreApplication.translate("Lexers", "HTML Files (*.html)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
517 QCoreApplication.translate("Lexers", "PHP Files (*.php)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
518 QCoreApplication.translate("Lexers", "ASP Files (*.asp)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
519 QCoreApplication.translate("Lexers", "CSS Files (*.css)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
520 QCoreApplication.translate("Lexers", "QSS Files (*.qss)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
521 QCoreApplication.translate("Lexers", "XML Files (*.xml)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
522 QCoreApplication.translate("Lexers", "XSL Files (*.xsl)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
523 QCoreApplication.translate("Lexers", "DTD Files (*.dtd)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
524 QCoreApplication.translate("Lexers", "Qt Resource Files (*.qrc)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
525 QCoreApplication.translate("Lexers", "D Files (*.d)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
526 QCoreApplication.translate("Lexers", "D Interface Files (*.di)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
527 QCoreApplication.translate("Lexers", "Java Files (*.java)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
528 QCoreApplication.translate("Lexers", "JavaScript Files (*.js)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
529 QCoreApplication.translate("Lexers", "SQL Files (*.sql)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
530 QCoreApplication.translate("Lexers", "Docbook Files (*.docbook)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
531 QCoreApplication.translate("Lexers", "Perl Files (*.pl)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
532 QCoreApplication.translate("Lexers", "Perl Module Files (*.pm)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
533 QCoreApplication.translate("Lexers", "Lua Files (*.lua)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
534 QCoreApplication.translate("Lexers", "Shell Files (*.sh)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
535 QCoreApplication.translate("Lexers", "Batch Files (*.bat)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
536 QCoreApplication.translate("Lexers", "TeX Files (*.tex)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
537 QCoreApplication.translate("Lexers", "TeX Template Files (*.sty)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
538 QCoreApplication.translate("Lexers", "Diff Files (*.diff)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
539 QCoreApplication.translate("Lexers", "Make Files (*.mak)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
540 QCoreApplication.translate("Lexers", "Properties Files (*.ini)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
541 QCoreApplication.translate("Lexers", "Configuration Files (*.cfg)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
542 QCoreApplication.translate("Lexers", "Povray Files (*.pov)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
543 QCoreApplication.translate("Lexers", "CMake Files (CMakeLists.txt)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
544 QCoreApplication.translate("Lexers", "CMake Macro Files (*.cmake)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
545 QCoreApplication.translate("Lexers", "VHDL Files (*.vhd)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
546 QCoreApplication.translate("Lexers", "TCL Files (*.tcl)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
547 QCoreApplication.translate("Lexers", "Tk Files (*.tk)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
548 QCoreApplication.translate("Lexers", "Fortran Files (*.f95)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
549 QCoreApplication.translate("Lexers", "Fortran77 Files (*.f)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
550 QCoreApplication.translate("Lexers", "Pascal Files (*.pas)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
551 QCoreApplication.translate("Lexers", "PostScript Files (*.ps)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
552 QCoreApplication.translate("Lexers", "YAML Files (*.yml)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
553 QCoreApplication.translate("Lexers", "TOML Files (*.toml)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
554 QCoreApplication.translate("Lexers", "Matlab Files (*.m)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
555 QCoreApplication.translate("Lexers", "Octave Files (*.m.octave)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
556 QCoreApplication.translate("Lexers", "Gettext Files (*.po)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
557 QCoreApplication.translate("Lexers", "CoffeeScript Files (*.coffee)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
558 QCoreApplication.translate("Lexers", "JSON Files (*.json)"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
559 QCoreApplication.translate("Lexers", "Markdown Files (*.md)"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
561
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 for name in LexerRegistry:
2710
8c91d494ad06 Fixed a serious issues in the Lexer.__init__.py module causing a traceback after a plug-in supplying several file filters was activated.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
563 saveFileFiltersList.extend(LexerRegistry[name][4])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
564
740
9625b5817d1c Started to implement user defined file filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 428
diff changeset
565 if withAdditional:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
566 saveFileFiltersList.extend(Preferences.getEditor("AdditionalSaveFilters"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
567
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 saveFileFiltersList.sort()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
569
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 if includeAll:
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2763
diff changeset
571 saveFileFiltersList.append(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
572 QCoreApplication.translate("Lexers", "All Files (*)")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
573 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
574
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 if asString:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
576 return ";;".join(saveFileFiltersList)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 return saveFileFiltersList
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
580
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 def getDefaultLexerAssociations():
993
03493183dd91 Added support for the Matlab and Octave lexers for QScintilla >= 2.5.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 992
diff changeset
582 """
03493183dd91 Added support for the Matlab and Octave lexers for QScintilla >= 2.5.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 992
diff changeset
583 Module function to get a dictionary with the default associations.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
584
993
03493183dd91 Added support for the Matlab and Octave lexers for QScintilla >= 2.5.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 992
diff changeset
585 @return dictionary with the default lexer associations
10431
64157aeb0312 Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10373
diff changeset
586 @rtype dict
993
03493183dd91 Added support for the Matlab and Octave lexers for QScintilla >= 2.5.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 992
diff changeset
587 """
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
588 assocs = {
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
589 "*.sh": "Bash",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
590 "*.bash": "Bash",
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
591 "*.bat": "Batch",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
592 "*.cmd": "Batch",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
593 "*.cpp": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
594 "*.cxx": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
595 "*.cc": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
596 "*.c": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
597 "*.hpp": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
598 "*.hh": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
599 "*.h": "C++",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
600 "*.cs": "C#",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
601 "CMakeLists.txt": "CMake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
602 "*.cmake": "CMake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
603 "*.cmake.in": "CMake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
604 "*.ctest": "CMake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
605 "*.ctest.in": "CMake",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
606 "*.css": "CSS",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
607 "*.qss": "QSS",
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
608 "*.d": "D",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
609 "*.di": "D",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
610 "*.diff": "Diff",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
611 "*.patch": "Diff",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
612 "*.html": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
613 "*.htm": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
614 "*.asp": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
615 "*.shtml": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
616 "*.php": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
617 "*.php3": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
618 "*.php4": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
619 "*.php5": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
620 "*.phtml": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
621 "*.docbook": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
622 "*.ui": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
623 "*.ts": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
624 "*.qrc": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
625 "*.kid": "HTML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
626 "*.java": "Java",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
627 "*.js": "JavaScript",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
628 "*.lua": "Lua",
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
629 "*makefile": "Makefile",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
630 "Makefile*": "Makefile",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
631 "*.mak": "Makefile",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
632 "*.pl": "Perl",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
633 "*.pm": "Perl",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
634 "*.ph": "Perl",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
635 "*.pov": "Povray",
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
636 "*.properties": "Properties",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
637 "*.ini": "Properties",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
638 "*.inf": "Properties",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
639 "*.reg": "Properties",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
640 "*.cfg": "Properties",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
641 "*.cnf": "Properties",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
642 "*.rc": "Properties",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
643 "*.py": "Python",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
644 "*.pyw": "Python",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
645 "*.py3": "Python",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
646 "*.pyw3": "Python",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
647 "*.pyx": "Cython",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
648 "*.pxd": "Cython",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
649 "*.pxi": "Cython",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
650 "*.ptl": "Python",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
651 "*.rb": "Ruby",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
652 "*.rbw": "Ruby",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
653 "*.sql": "SQL",
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
654 "*.tex": "TeX",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
655 "*.sty": "TeX",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
656 "*.aux": "TeX",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
657 "*.toc": "TeX",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
658 "*.idx": "TeX",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
659 "*.vhd": "VHDL",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
660 "*.vhdl": "VHDL",
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
661 "*.tcl": "TCL",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
662 "*.tk": "TCL",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
663 "*.f": "Fortran77",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
664 "*.for": "Fortran77",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
665 "*.f90": "Fortran",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
666 "*.f95": "Fortran",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
667 "*.f2k": "Fortran",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
668 "*.dpr": "Pascal",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
669 "*.dpk": "Pascal",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
670 "*.pas": "Pascal",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
671 "*.dfm": "Pascal",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
672 "*.inc": "Pascal",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
673 "*.pp": "Pascal",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
674 "*.ps": "PostScript",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
675 "*.xml": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
676 "*.xsl": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
677 "*.svg": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
678 "*.xsd": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
679 "*.xslt": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
680 "*.dtd": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
681 "*.rdf": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
682 "*.xul": "XML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
683 "*.yaml": "YAML",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
684 "*.yml": "YAML",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
685 "*.m": "Matlab",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
686 "*.m.matlab": "Matlab",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
687 "*.m.octave": "Octave",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
688 "*.ecj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
689 "*.edj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
690 "*.egj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
691 "*.ehj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
692 "*.ekj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
693 "*.emj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
694 "*.epj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
695 "*.eqj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
696 "*.esj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
697 "*.etj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
698 "*.ethj": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
699 "*.po": "Gettext",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
700 "*.coffee": "CoffeeScript",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
701 "*.json": "JSON",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
702 "*.md": "Markdown",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
703 "*.toml": "Pygments|TOML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
704 "Pipfile": "Pygments|TOML",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
705 "poetry.lock": "Pygments|TOML",
10682
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10595
diff changeset
706 "*.groovy": "Pygments|Groovy",
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10595
diff changeset
707 "Jenkinsfile": "Pygments|Groovy",
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10595
diff changeset
708 "*.jenkinsfile": "Pygments|Groovy",
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10595
diff changeset
709 "Jenkinsfile.*": "Pygments|Groovy",
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
710 }
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
711
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
712 for name in LexerRegistry:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713 for pattern in LexerRegistry[name][5]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
714 assocs[pattern] = name
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
715
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716 return assocs

eric ide

mercurial