6 """ |
6 """ |
7 Module implementing the Ericdoc plugin. |
7 Module implementing the Ericdoc 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 |
51 dataList = [] |
52 dataList = [] |
52 |
53 |
53 # 1. eric7_doc |
54 # 1. eric7_doc |
54 exe = 'eric7_doc' |
55 exe = 'eric7_doc' |
55 if Utilities.isWindowsPlatform(): |
56 if Utilities.isWindowsPlatform(): |
56 exe = os.path.join(getConfig("bindir"), exe + '.cmd') |
57 for exepath in ( |
57 if not os.path.exists(exe): |
58 getConfig("bindir"), |
58 exe = os.path.join(getConfig("bindir"), exe + '.bat') |
59 os.path.join(sys.exec_prefix, "Scripts"), |
|
60 ): |
|
61 found = False |
|
62 for ext in (".exe", ".cmd", ".bat"): |
|
63 exe_ = os.path.join(exepath, exe + ext) |
|
64 if os.path.exists(exe_): |
|
65 exe = exe_ |
|
66 found = True |
|
67 break |
|
68 if found: |
|
69 break |
59 else: |
70 else: |
60 exe = os.path.join(getConfig("bindir"), exe) |
71 for exepath in ( |
|
72 getConfig("bindir"), |
|
73 os.path.join(sys.exec_prefix, "bin"), |
|
74 ): |
|
75 exe_ = os.path.join(exepath, exe) |
|
76 if os.path.exists(exe_): |
|
77 exe = exe_ |
|
78 break |
|
79 |
61 dataList.append({ |
80 dataList.append({ |
62 "programEntry": True, |
81 "programEntry": True, |
63 "header": QCoreApplication.translate( |
82 "header": QCoreApplication.translate( |
64 "EricdocPlugin", "eric Documentation Generator"), |
83 "EricdocPlugin", "eric Documentation Generator"), |
65 "exe": exe, |
84 "exe": exe, |