8 """ |
8 """ |
9 |
9 |
10 import contextlib |
10 import contextlib |
11 import os |
11 import os |
12 |
12 |
13 from PyQt6.QtCore import QObject, QTranslator, pyqtSlot |
13 from PyQt6.QtCore import QCoreApplication, QObject, QTranslator, pyqtSlot |
14 |
14 |
15 from eric7 import Preferences |
15 from eric7 import Preferences |
16 from eric7.EricGui.EricAction import EricAction |
16 from eric7.EricGui.EricAction import EricAction |
17 from eric7.EricWidgets.EricApplication import ericApp |
17 from eric7.EricWidgets.EricApplication import ericApp |
18 from eric7.Project.ProjectBrowserModel import ProjectBrowserFileItem |
18 from eric7.Project.ProjectBrowserModel import ProjectBrowserFileItem |
|
19 from eric7.SystemUtilities import PythonUtilities |
19 |
20 |
20 # Start-Of-Header |
21 # Start-Of-Header |
21 __header__ = { |
22 __header__ = { |
22 "name": "Python Typing Checker Plug-in", |
23 "name": "Python Typing Checker Plug-in", |
23 "author": "Detlev Offenbach <detlev@die-offenbachs.de>", |
24 "author": "Detlev Offenbach <detlev@die-offenbachs.de>", |
34 # End-Of-Header |
35 # End-Of-Header |
35 |
36 |
36 error = "" # noqa: U200 |
37 error = "" # noqa: U200 |
37 |
38 |
38 |
39 |
|
40 def exeDisplayData(): |
|
41 """ |
|
42 Public method to support the display of some executable info. |
|
43 |
|
44 @return dictionary containing the data to query the presence of |
|
45 the executable |
|
46 @rtype dict |
|
47 """ |
|
48 data = { |
|
49 "programEntry": True, |
|
50 "header": QCoreApplication.translate( |
|
51 "PyrightPlugin", "Checkers - Pyright" |
|
52 ), |
|
53 "exe": PythonUtilities.getPythonExecutable(), |
|
54 "versionCommand": "--version", |
|
55 "versionStartsWith": "pyright", |
|
56 "versionPosition": -1, |
|
57 "version": "", |
|
58 "versionCleanup": None, |
|
59 "exeModule": ["-m", "pyright"] |
|
60 } |
|
61 |
|
62 return data |
|
63 |
|
64 |
39 def prepareUninstall(): |
65 def prepareUninstall(): |
40 """ |
66 """ |
41 Module function to prepare for an uninstallation. |
67 Module function to prepare for an uninstallation. |
42 """ |
68 """ |
43 Preferences.Prefs.settings.remove(PyrightPlugin.PreferencesKey) |
69 Preferences.Prefs.settings.remove(PyrightPlugin.PreferencesKey) |