Mon, 10 Feb 2020 19:49:45 +0100
Continued with the multiprocess debugger.
--- a/eric6/DebugClients/Python/ModuleLoader.py Mon Feb 10 18:49:49 2020 +0100 +++ b/eric6/DebugClients/Python/ModuleLoader.py Mon Feb 10 19:49:45 2020 +0100 @@ -28,12 +28,6 @@ self.__enableImportHooks = True - # TODO: check if needed - if sys.version_info[0] == 2: - self.threadModName = 'thread' - else: - self.threadModName = '_thread' - # reset already imported thread module to apply hooks at next import for moduleName in ("thread", "_thread", "threading"): if moduleName in sys.modules:
--- a/eric6/Debugger/DebugServer.py Mon Feb 10 18:49:49 2020 +0100 +++ b/eric6/Debugger/DebugServer.py Mon Feb 10 19:49:45 2020 +0100 @@ -86,9 +86,9 @@ the client banner data was received @signal clientCapabilities(capabilities, cltype, venvname) emitted after the clients capabilities were received - @signal clientCompletionList(completionList, text) emitted after the client - the commandline completion list and the reworked searchstring was - received from the client + @signal clientCompletionList(completionList, text, debuggerId) emitted + after the client the commandline completion list and the reworked + search string was received from the client @signal passiveDebugStarted(str, bool) emitted after the debug client has connected in passive debug mode @signal clientGone(bool) emitted if the client went away (planned or @@ -146,7 +146,7 @@ clientRawInput = pyqtSignal(str, bool, str) clientBanner = pyqtSignal(str, str, str, str) clientCapabilities = pyqtSignal(int, str, str) - clientCompletionList = pyqtSignal(list, str) + clientCompletionList = pyqtSignal(list, str, str) clientInterpreterChanged = pyqtSignal(str) clientDebuggerIds = pyqtSignal(list) utDiscovered = pyqtSignal(list, str, str) @@ -1468,14 +1468,16 @@ """ self.debuggerInterface.remoteCapabilities() - def remoteCompletion(self, text): + def remoteCompletion(self, debuggerId, text): """ Public slot to get the a list of possible commandline completions from the remote client. - @param text the text to be completed (string) + @param debuggerId ID of the debugger backend + @type str + @param text the text to be completed + @type str """ - # TODO: send this to the currently selected debugger self.debuggerInterface.remoteCompletion(text) def remoteUTDiscover(self, clientType, forProject, venvName, syspath, @@ -1901,7 +1903,7 @@ # ignore silently pass - def signalClientCompletionList(self, completionList, text): + def signalClientCompletionList(self, completionList, text, debuggerId): """ Public method to process the client auto completion info. @@ -1909,6 +1911,8 @@ @type list of str @param text the text to be completed @type str + @param debuggerId ID of the debugger backend + @type str """ self.clientCompletionList.emit(completionList, text)
--- a/eric6/Debugger/DebugUI.py Mon Feb 10 18:49:49 2020 +0100 +++ b/eric6/Debugger/DebugUI.py Mon Feb 10 19:49:45 2020 +0100 @@ -2023,6 +2023,7 @@ cap = self.tr("Debug Project") else: cap = self.tr("Debug Script") + # TODO: add "Multiprocess" checkbox and pass to debugger dlg = StartDialog( cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, self.envHistory, self.exceptions, self.ui, 0,
--- a/eric6/Debugger/DebuggerInterfacePython.py Mon Feb 10 18:49:49 2020 +0100 +++ b/eric6/Debugger/DebuggerInterfacePython.py Mon Feb 10 19:49:45 2020 +0100 @@ -1133,17 +1133,19 @@ """ self.__sendJsonCommand("RequestCapabilities", {}, debuggerId) - def remoteCompletion(self, text): + def remoteCompletion(self, debuggerId, text): """ Public slot to get the a list of possible commandline completions from the remote client. + @param debuggerId ID of the debugger backend + @type str @param text the text to be completed @type str """ self.__sendJsonCommand("RequestCompletion", { "text": text, - }) + }, debuggerId) def remoteUTDiscover(self, syspath, workdir, discoveryStart): """ @@ -1467,10 +1469,8 @@ params["debuggerId"]) elif method == "ResponseCompletion": - if params["debuggerId"] == self.__master: - # signal only for the master connection - self.debugServer.signalClientCompletionList( - params["completions"], params["text"]) + self.debugServer.signalClientCompletionList( + params["completions"], params["text"], params["debuggerId"]) ################################################################### ## Unit test related stuff is not done with multi processing
--- a/eric6/QScintilla/Shell.py Mon Feb 10 18:49:49 2020 +0100 +++ b/eric6/QScintilla/Shell.py Mon Feb 10 19:49:45 2020 +0100 @@ -16,7 +16,7 @@ except ImportError: from ThirdParty.enum import Enum -from PyQt5.QtCore import pyqtSignal, QFileInfo, Qt, QEvent +from PyQt5.QtCore import pyqtSignal, pyqtSlot, QFileInfo, Qt, QEvent from PyQt5.QtGui import QClipboard, QPalette, QFont from PyQt5.QtWidgets import ( QDialog, QInputDialog, QApplication, QMenu, QWidget, QHBoxLayout, @@ -244,6 +244,8 @@ dbs.clientSignal.connect(self.__clientSignal) self.dbs = dbs + self.__debugUI = None + # Initialize instance variables. self.__initialise() self.prline = 0 @@ -603,6 +605,7 @@ @param ui reference to the debugger UI object (DebugUI) """ ui.exceptionInterrupt.connect(self.__writePrompt) + self.__debugUI = ui def __initialise(self): """ @@ -1335,7 +1338,10 @@ super(Shell, self).keyPressEvent(ev) self.incrementalSearchActive = True if ac and self.racEnabled: - self.dbs.remoteCompletion(self.completionText + txt) + self.dbs.remoteCompletion( + self.__debugUI.getSelectedDebuggerId(), + self.completionText + txt + ) else: self.__insertTextNoEcho(txt) else: @@ -1367,7 +1373,10 @@ if self.inContinue and not buf[:index - len(sys.ps2)].strip(): self.SendScintilla(cmd) elif self.racEnabled: - self.dbs.remoteCompletion(buf) + self.dbs.remoteCompletion( + self.__debugUI.getSelectedDebuggerId(), + buf + ) def __QScintillaLeftDeleteCommand(self, method): """ @@ -1395,7 +1404,10 @@ db = 1 if db and ac and self.racEnabled and self.completionText: delta = len(self.text(line)) - oldLength - self.dbs.remoteCompletion(self.completionText[:delta]) + self.dbs.remoteCompletion( + self.__debugUI.getSelectedDebuggerId(), + self.completionText[:delta] + ) def __QScintillaDeleteBack(self): """ @@ -1862,10 +1874,8 @@ self.vm.quit() return - self.dbs.remoteStatement( - e5App().getObject("DebugUI").getSelectedDebuggerId(), - cmd - ) + self.dbs.remoteStatement(self.__debugUI.getSelectedDebuggerId(), + cmd) while self.inCommandExecution: try: QApplication.processEvents() @@ -2081,7 +2091,8 @@ self.dbs.clientProcessStdout.disconnect(self.__writeStdOut) self.dbs.clientProcessStderr.disconnect(self.__writeStdErr) self.__showStdOutErr = showStdOutErr - + + @pyqtSlot(list, str) def __showCompletions(self, completions, text): """ Private method to display the possible completions.