src/eric7/Preferences/HighlightingStylesFile.py

Fri, 29 Jul 2022 16:29:31 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 29 Jul 2022 16:29:31 +0200
branch
eric7
changeset 9278
36448ca469c2
parent 9221
bf71ee032bb4
child 9413
80c06d472826
permissions
-rw-r--r--

Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.

8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
3 # Copyright (c) 2021 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a class representing the highlighting styles JSON file.
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import json
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import time
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
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 QObject
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
8358
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
15 from EricWidgets import EricMessageBox
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
16 from EricGui.EricOverrideCursor import EricOverridenCursor
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import Preferences
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 class HighlightingStylesFile(QObject):
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Class representing the highlighting styles JSON file.
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
25
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 def __init__(self, parent: QObject = None):
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
29
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @param parent reference to the parent object (defaults to None)
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @type QObject (optional)
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8103
diff changeset
33 super().__init__(parent)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
34
8103
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
35 self.__lexerAliases = {
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
36 "PO": "Gettext",
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
37 "POV": "Povray",
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
38 }
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
39
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 def writeFile(self, filename: str, lexers: list) -> bool:
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 Public method to write the highlighting styles data to a highlighting
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 styles JSON file.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
44
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 @param filename name of the highlighting styles file
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 @type str
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 @param lexers list of lexers for which to export the styles
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 @type list of PreferencesLexer
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 @return flag indicating a successful write
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 @rtype bool
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
9278
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
52 stylesDict = {
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
53 # step 0: header
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
54 "header": {
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
55 "comment": "eric highlighting styles file",
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
56 "saved": time.strftime("%Y-%m-%d, %H:%M:%S"),
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
57 "author": Preferences.getUser("Email"),
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
58 },
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
59 # step 1: add the lexer style data
36448ca469c2 Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
60 "lexers": [],
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 }
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 for lexer in lexers:
8103
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
63 name = lexer.language()
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
64 if name in self.__lexerAliases:
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
65 name = self.__lexerAliases[name]
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 lexerDict = {
8103
338fe0064e5a HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8028
diff changeset
67 "name": name,
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 "styles": [],
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 }
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 for description, style, substyle in lexer.getStyles():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
71 lexerDict["styles"].append(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
72 {
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
73 "description": description,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
74 "style": style,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75 "substyle": substyle,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
76 "color": lexer.color(style, substyle).name(),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
77 "paper": lexer.paper(style, substyle).name(),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
78 "font": lexer.font(style, substyle).toString(),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
79 "eolfill": lexer.eolFill(style, substyle),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
80 "words": lexer.words(style, substyle).strip(),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81 }
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
82 )
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 stylesDict["lexers"].append(lexerDict)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
84
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 try:
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 jsonString = json.dumps(stylesDict, indent=2)
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 with open(filename, "w") as f:
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 f.write(jsonString)
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
89 except (TypeError, OSError) as err:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
90 with EricOverridenCursor():
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
91 EricMessageBox.critical(
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 None,
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.tr("Export Highlighting Styles"),
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.tr(
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 "<p>The highlighting styles file <b>{0}</b> could not"
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 " be written.</p><p>Reason: {1}</p>"
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
97 ).format(filename, str(err)),
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 )
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 return False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
100
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 return True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
102
8028
a4f1b68c0737 Highlighting Styles: changed the import/export logic to allow the selection of lexers to be imported/exported.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8026
diff changeset
103 def readFile(self, filename: str) -> list:
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 Public method to read the highlighting styles data from a highlighting
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 styles JSON file.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
107
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 @param filename name of the highlighting styles file
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 @type str
8026
d3eacdbcb18b Changed the highlighting styles import logic thus, that the imported styles are applied in the configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8022
diff changeset
110 @return list of read lexer style definitions
d3eacdbcb18b Changed the highlighting styles import logic thus, that the imported styles are applied in the configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8022
diff changeset
111 @rtype list of dict
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 """
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 try:
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 with open(filename, "r") as f:
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 jsonString = f.read()
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 stylesDict = json.loads(jsonString)
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
117 except (OSError, json.JSONDecodeError) as err:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
118 EricMessageBox.critical(
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 None,
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.tr("Import Highlighting Styles"),
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 self.tr(
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 "<p>The highlighting styles file <b>{0}</b> could not be"
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 " read.</p><p>Reason: {1}</p>"
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
124 ).format(filename, str(err)),
8022
2da0139f4f91 Implemented the JSON based highlighting styles files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 )
8026
d3eacdbcb18b Changed the highlighting styles import logic thus, that the imported styles are applied in the configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8022
diff changeset
126 return []
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
127
8026
d3eacdbcb18b Changed the highlighting styles import logic thus, that the imported styles are applied in the configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8022
diff changeset
128 return stylesDict["lexers"]

eric ide

mercurial