RefactoringRope/JsonServer.py

changeset 285
247d62c682dc
parent 265
68152c23837a
child 293
dd1c7ed6d880
diff -r 18f32c079abc -r 247d62c682dc RefactoringRope/JsonServer.py
--- a/RefactoringRope/JsonServer.py	Sun Oct 28 12:30:59 2018 +0100
+++ b/RefactoringRope/JsonServer.py	Sat Nov 03 18:21:20 2018 +0100
@@ -11,7 +11,7 @@
 
 import json
 
-from PyQt5.QtCore import pyqtSlot, QProcess
+from PyQt5.QtCore import pyqtSlot, QProcess, QProcessEnvironment
 from PyQt5.QtNetwork import QTcpServer, QHostAddress
 
 from E5Gui import E5MessageBox
@@ -204,7 +204,8 @@
             if flush:
                 connection.flush()
     
-    def startClient(self, interpreter, clientScript, clientArgs, idString=""):
+    def startClient(self, interpreter, clientScript, clientArgs, idString="",
+                    environment=None):
         """
         Public method to start a client process.
         
@@ -215,6 +216,8 @@
         @param clientArgs list of arguments for the client
         @param idString id of the client to be started
         @type str
+        @param environment dictionary of environment settings to pass
+        @type dict
         @return flag indicating a successful client start
         @rtype bool
         """
@@ -223,6 +226,11 @@
         
         proc = QProcess()
         proc.setProcessChannelMode(QProcess.ForwardedChannels)
+        if environment is not None:
+            env = QProcessEnvironment()
+            for key, value in list(environment.items()):
+                env.insert(key, value)
+            proc.setProcessEnvironment(env)
         args = [clientScript, self.__hostAddress, str(self.serverPort())]
         if idString:
             args.append(idString)

eric ide

mercurial