11 |
11 |
12 import sys |
12 import sys |
13 import os |
13 import os |
14 import re |
14 import re |
15 |
15 |
16 from PyQt4.QtCore import QObject, QTextCodec, QProcess, QTimer |
16 from PyQt5.QtCore import QObject, QTextCodec, QProcess, QProcessEnvironment, \ |
17 from PyQt4.QtGui import QInputDialog |
17 QTimer |
|
18 from PyQt5.QtWidgets import QInputDialog |
18 |
19 |
19 from E5Gui.E5Application import e5App |
20 from E5Gui.E5Application import e5App |
20 from E5Gui import E5MessageBox |
21 from E5Gui import E5MessageBox |
21 |
22 |
22 from . import DebugProtocol |
23 from . import DebugProtocol |
130 (dict of string) |
131 (dict of string) |
131 @return the process object (QProcess) or None |
132 @return the process object (QProcess) or None |
132 """ |
133 """ |
133 proc = QProcess() |
134 proc = QProcess() |
134 if environment is not None: |
135 if environment is not None: |
135 env = [] |
136 env = QProcessEnvironment() |
136 for key, value in list(environment.items()): |
137 for key, value in list(environment.items()): |
137 env.append("{0}={1}".format(key, value)) |
138 env.insert(key, value) |
138 proc.setEnvironment(env) |
139 proc.setProcessEnvironment(env) |
139 args = [] |
140 args = [] |
140 for arg in arguments: |
141 for arg in arguments: |
141 args.append(arg) |
142 args.append(arg) |
142 proc.start(program, args) |
143 proc.start(program, args) |
143 if not proc.waitForStarted(10000): |
144 if not proc.waitForStarted(10000): |