13 import os |
13 import os |
14 import re |
14 import re |
15 import subprocess # secok |
15 import subprocess # secok |
16 import sys |
16 import sys |
17 |
17 |
18 from PyQt6.QtCore import pyqtSlot, QObject, QFileInfo, QTimer, QUrl, QIODeviceBase |
18 from PyQt6.QtCore import ( |
|
19 QFileInfo, |
|
20 QIODeviceBase, |
|
21 QObject, |
|
22 QProcess as QProcessPyQt, |
|
23 QTimer, |
|
24 QUrl, |
|
25 pyqtSlot, |
|
26 ) |
19 from PyQt6.QtGui import QDesktopServices |
27 from PyQt6.QtGui import QDesktopServices |
20 from PyQt6.QtWidgets import QMenu, QDialog, QInputDialog, QLineEdit |
28 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit, QMenu |
21 from PyQt6.QtCore import QProcess as QProcessPyQt |
|
22 |
29 |
23 from eric7 import Preferences, Utilities |
30 from eric7 import Preferences, Utilities |
24 from eric7.EricGui.EricAction import EricAction |
31 from eric7.EricGui.EricAction import EricAction |
|
32 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
25 from eric7.EricWidgets.EricApplication import ericApp |
33 from eric7.EricWidgets.EricApplication import ericApp |
26 from eric7.EricWidgets import EricMessageBox, EricFileDialog |
34 |
27 from eric7.Globals import isWindowsPlatform |
35 try: |
|
36 from eric7.SystemUtilities.FileSystemUtilities import ( |
|
37 getExecutablePath, |
|
38 getExecutablePaths, |
|
39 ) |
|
40 except ImportError: |
|
41 # imports for eric < 23.1 |
|
42 from eric7.Utilities import getExecutablePath, getExecutablePaths |
|
43 try: |
|
44 from eric7.SystemUtilities.OSUtilities import isWindowsPlatform |
|
45 except ImportError: |
|
46 # imports for eric < 23.1 |
|
47 from eric7.Globals import isWindowsPlatform |
28 |
48 |
29 try: |
49 try: |
30 from eric7.EricGui import EricPixmapCache |
50 from eric7.EricGui import EricPixmapCache |
31 except ImportError: |
51 except ImportError: |
32 from UI import PixmapCache as EricPixmapCache |
52 from UI import PixmapCache as EricPixmapCache |
838 if fullCmd != cmd: |
858 if fullCmd != cmd: |
839 variants.append(variant) |
859 variants.append(variant) |
840 else: |
860 else: |
841 if cmd: |
861 if cmd: |
842 try: |
862 try: |
843 fullCmds = Utilities.getExecutablePaths(cmd) |
863 fullCmds = getExecutablePaths(cmd) |
844 except AttributeError: |
864 except AttributeError: |
845 fullCmds = self.__getExecutablePaths(cmd) |
865 fullCmds = self.__getExecutablePaths(cmd) |
846 for fullCmd in fullCmds: |
866 for fullCmd in fullCmds: |
847 try: |
867 try: |
848 with open(fullCmd, "r", encoding="utf-8") as f: |
868 with open(fullCmd, "r", encoding="utf-8") as f: |
971 break |
991 break |
972 else: |
992 else: |
973 fullCmds = [ |
993 fullCmds = [ |
974 os.path.join(virtualEnv, "bin", cmd), |
994 os.path.join(virtualEnv, "bin", cmd), |
975 os.path.join(virtualEnv, "local", "bin", cmd), |
995 os.path.join(virtualEnv, "local", "bin", cmd), |
976 Utilities.getExecutablePath(cmd), |
996 getExecutablePath(cmd), |
977 cmd, # fall back to just cmd |
997 cmd, # fall back to just cmd |
978 ] |
998 ] |
979 for cmd in fullCmds: |
999 for cmd in fullCmds: |
980 if os.path.exists(cmd): |
1000 if os.path.exists(cmd): |
981 break |
1001 break |