12 import re |
12 import re |
13 |
13 |
14 from PyQt6.QtCore import QObject, QProcess, pyqtSlot |
14 from PyQt6.QtCore import QObject, QProcess, pyqtSlot |
15 from PyQt6.QtWidgets import QDialog, QMenu |
15 from PyQt6.QtWidgets import QDialog, QMenu |
16 |
16 |
17 from eric7 import Utilities |
|
18 from eric7.EricGui.EricAction import EricAction |
17 from eric7.EricGui.EricAction import EricAction |
19 from eric7.EricWidgets import EricMessageBox |
18 from eric7.EricWidgets import EricMessageBox |
20 from eric7.EricWidgets.EricApplication import ericApp |
19 from eric7.EricWidgets.EricApplication import ericApp |
|
20 |
|
21 try: |
|
22 from eric7.SystemUtilities.FileSystemUtilities import isinpath |
|
23 except ImportError: |
|
24 # imports for eric < 23.1 |
|
25 from eric7.Utilities import isinpath |
21 |
26 |
22 from .PyBabelCommandDialog import PyBabelCommandDialog |
27 from .PyBabelCommandDialog import PyBabelCommandDialog |
23 |
28 |
24 |
29 |
25 class PyBabelProject(QObject): |
30 class PyBabelProject(QObject): |
252 |
257 |
253 @return flag indicating the availability of 'flask-babel' |
258 @return flag indicating the availability of 'flask-babel' |
254 @rtype bool |
259 @rtype bool |
255 """ |
260 """ |
256 interpreter = self.__project.getVirtualenvInterpreter() |
261 interpreter = self.__project.getVirtualenvInterpreter() |
257 if interpreter and Utilities.isinpath(interpreter): |
262 if interpreter and isinpath(interpreter): |
258 detector = os.path.join(os.path.dirname(__file__), "FlaskBabelDetector.py") |
263 detector = os.path.join(os.path.dirname(__file__), "FlaskBabelDetector.py") |
259 proc = QProcess() |
264 proc = QProcess() |
260 proc.setProcessChannelMode(QProcess.ProcessChannelMode.MergedChannels) |
265 proc.setProcessChannelMode(QProcess.ProcessChannelMode.MergedChannels) |
261 proc.start(interpreter, [detector]) |
266 proc.start(interpreter, [detector]) |
262 finished = proc.waitForFinished(30000) |
267 finished = proc.waitForFinished(30000) |