6 """ |
6 """ |
7 Module implementing the Ericapi plugin. |
7 Module implementing the Ericapi plugin. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
|
11 import sys |
11 |
12 |
12 from PyQt6.QtCore import QObject, QCoreApplication |
13 from PyQt6.QtCore import QObject, QCoreApplication |
13 from PyQt6.QtWidgets import QDialog |
14 from PyQt6.QtWidgets import QDialog |
14 |
15 |
15 from EricWidgets.EricApplication import ericApp |
16 from EricWidgets.EricApplication import ericApp |
48 @return dictionary containing the data to query the presence of |
49 @return dictionary containing the data to query the presence of |
49 the executable |
50 the executable |
50 """ |
51 """ |
51 exe = 'eric7_api' |
52 exe = 'eric7_api' |
52 if Utilities.isWindowsPlatform(): |
53 if Utilities.isWindowsPlatform(): |
53 exe = os.path.join(getConfig("bindir"), exe + '.cmd') |
54 for exepath in ( |
54 if not os.path.exists(exe): |
55 getConfig("bindir"), |
55 exe = os.path.join(getConfig("bindir"), exe + '.bat') |
56 os.path.join(sys.exec_prefix, "Scripts"), |
|
57 ): |
|
58 found = False |
|
59 for ext in (".exe", ".cmd", ".bat"): |
|
60 exe_ = os.path.join(exepath, exe + ext) |
|
61 if os.path.exists(exe_): |
|
62 exe = exe_ |
|
63 found = True |
|
64 break |
|
65 if found: |
|
66 break |
56 else: |
67 else: |
57 exe = os.path.join(getConfig("bindir"), exe) |
68 for exepath in ( |
|
69 getConfig("bindir"), |
|
70 os.path.join(sys.exec_prefix, "bin"), |
|
71 ): |
|
72 exe_ = os.path.join(exepath, exe) |
|
73 if os.path.exists(exe_): |
|
74 exe = exe_ |
|
75 break |
58 |
76 |
59 data = { |
77 data = { |
60 "programEntry": True, |
78 "programEntry": True, |
61 "header": QCoreApplication.translate( |
79 "header": QCoreApplication.translate( |
62 "EricapiPlugin", "eric API File Generator"), |
80 "EricapiPlugin", "eric API File Generator"), |