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