10 """ |
10 """ |
11 |
11 |
12 from PyQt6.QtCore import QObject, pyqtSignal |
12 from PyQt6.QtCore import QObject, pyqtSignal |
13 |
13 |
14 from eric7.EricWidgets.EricApplication import ericApp |
14 from eric7.EricWidgets.EricApplication import ericApp |
15 from eric7.Utilities import determinePythonVersion |
15 from eric7.SystemUtilities import PythonUtilities |
16 |
16 |
17 |
17 |
18 class SyntaxCheckService(QObject): |
18 class SyntaxCheckService(QObject): |
19 """ |
19 """ |
20 Implement the syntax check service. |
20 Implement the syntax check service. |
50 |
50 |
51 @param filename of the sourcefile (str) |
51 @param filename of the sourcefile (str) |
52 @param source code of the file (str) |
52 @param source code of the file (str) |
53 @return language of the file or None if not found (str or None) |
53 @return language of the file or None if not found (str or None) |
54 """ |
54 """ |
55 pyVer = determinePythonVersion(filename, source) |
55 pyVer = PythonUtilities.determinePythonVersion(filename, source) |
56 if pyVer: |
56 if pyVer: |
57 return "Python{0}".format(pyVer) |
57 return "Python{0}".format(pyVer) |
58 |
58 |
59 for lang, (_env, _getArgs, getExt) in self.__supportedLanguages.items(): |
59 for lang, (_env, _getArgs, getExt) in self.__supportedLanguages.items(): |
60 if filename.endswith(tuple(getExt())): |
60 if filename.endswith(tuple(getExt())): |