15 |
15 |
16 from eric7 import Preferences |
16 from eric7 import Preferences |
17 from eric7.EricGui.EricAction import EricAction |
17 from eric7.EricGui.EricAction import EricAction |
18 from eric7.EricWidgets.EricApplication import ericApp |
18 from eric7.EricWidgets.EricApplication import ericApp |
19 from eric7.Project.ProjectBrowserModel import ProjectBrowserFileItem |
19 from eric7.Project.ProjectBrowserModel import ProjectBrowserFileItem |
|
20 from eric7.SystemUtilities import PythonUtilities |
20 from eric7.UI import Info |
21 from eric7.UI import Info |
21 from eric7.Utilities import determinePythonVersion |
|
22 |
22 |
23 # Start-Of-Header |
23 # Start-Of-Header |
24 name = "Code Style Checker Plugin" |
24 name = "Code Style Checker Plugin" |
25 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
25 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
26 autoactivate = True |
26 autoactivate = True |
161 encoding, backup) |
161 encoding, backup) |
162 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
162 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
163 bool, str, dict, dict, list of str, str, str, bool) |
163 bool, str, dict, dict, list of str, str, str, bool) |
164 """ |
164 """ |
165 if lang is None: |
165 if lang is None: |
166 lang = "Python{0}".format(determinePythonVersion(filename, source)) |
166 lang = "Python{0}".format( |
|
167 PythonUtilities.determinePythonVersion(filename, source) |
|
168 ) |
167 if lang != "Python3": |
169 if lang != "Python3": |
168 return |
170 return |
169 |
171 |
170 data = [source, args] |
172 data = [source, args] |
171 self.backgroundService.enqueueRequest("style", lang, filename, data) |
173 self.backgroundService.enqueueRequest("style", lang, filename, data) |
181 """ |
183 """ |
182 data = { |
184 data = { |
183 "Python3": [], |
185 "Python3": [], |
184 } |
186 } |
185 for filename, source, args in argumentsList: |
187 for filename, source, args in argumentsList: |
186 lang = "Python{0}".format(determinePythonVersion(filename, source)) |
188 lang = "Python{0}".format( |
|
189 PythonUtilities.determinePythonVersion(filename, source) |
|
190 ) |
187 if lang != "Python3": |
191 if lang != "Python3": |
188 continue |
192 continue |
189 else: |
193 else: |
190 data[lang].append((filename, source, args)) |
194 data[lang].append((filename, source, args)) |
191 |
195 |