src/eric7/Debugger/DebugServer.py

branch
eric7
changeset 10417
c6011e501282
parent 10373
093dcebe5ecb
child 10423
299802979277
--- a/src/eric7/Debugger/DebugServer.py	Sat Dec 16 17:52:02 2023 +0100
+++ b/src/eric7/Debugger/DebugServer.py	Sun Dec 17 17:15:19 2023 +0100
@@ -973,16 +973,22 @@
         Public method to set the environment for a program to debug, run, ...
 
         @param env environment settings
-        @type str
+        @type str or dict
+        @exception TypeError taised to indicate an unsupported parameter type
         """
-        envlist = shlex.split(env)
-        envdict = {}
-        for el in envlist:
-            if "=" in el:
-                key, value = el.split("=", 1)
-                envdict[key] = value
-            else:
-                envdict[el] = ""
+        if not isinstance(env, (dict, str)):
+            raise TypeError("'env' must be of type str or list of str")
+        elif isinstance(env, str):
+            envlist = shlex.split(env)
+            envdict = {}
+            for el in envlist:
+                if "=" in el:
+                    key, value = el.split("=", 1)
+                    envdict[key] = value
+                else:
+                    envdict[el] = ""
+        else:
+            envdict = env
         self.debuggerInterface.remoteEnvironment(envdict)
 
     def remoteLoad(
@@ -1009,14 +1015,14 @@
 
         @param venvName name of the virtual environment to be used
         @type str
-        @param fn the filename to debug
+        @param fn filename to debug
         @type str
-        @param argv the command line arguments to pass to the program
-        @type str
-        @param wd the working directory for the program
+        @param argv list of command line arguments to pass to the program
+        @type list of str
+        @param wd working directory for the program
         @type str
         @param env environment parameter settings
-        @type str
+        @type str or dict
         @param autoClearShell flag indicating, that the interpreter window
             should be cleared
         @type bool
@@ -1120,14 +1126,14 @@
 
         @param venvName name of the virtual environment to be used
         @type str
-        @param fn the filename to debug
+        @param fn filename to debug
         @type str
-        @param argv the command line arguments to pass to the program
-        @type str
-        @param wd the working directory for the program
+        @param argv list of command line arguments to pass to the program
+        @type list str
+        @param wd  working directory for the program
         @type str
         @param env environment parameter settings
-        @type str
+        @type str or dict
         @param autoClearShell flag indicating, that the interpreter window
             should be cleared
         @type bool
@@ -1199,14 +1205,14 @@
 
         @param venvName name of the virtual environment to be used
         @type str
-        @param fn the filename to debug
+        @param fn filename to debug
         @type str
-        @param argv the command line arguments to pass to the program
-        @type str
-        @param wd the working directory for the program
+        @param argv list of command line arguments to pass to the program
+        @type list of str
+        @param wd working directory for the program
         @type str
         @param env environment parameter settings
-        @type str
+        @type str or dict
         @param autoClearShell flag indicating, that the interpreter window
             should be cleared
         @type bool
@@ -1281,14 +1287,14 @@
 
         @param venvName name of the virtual environment to be used
         @type str
-        @param fn the filename to debug
+        @param fn filename to debug
         @type str
-        @param argv the command line arguments to pass to the program
-        @type str
-        @param wd the working directory for the program
+        @param argv list of command line arguments to pass to the program
+        @type list of str
+        @param wd working directory for the program
         @type str
         @param env environment parameter settings
-        @type str
+        @type str or dict
         @param autoClearShell flag indicating, that the interpreter window
             should be cleared
         @type bool
@@ -1350,7 +1356,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param stmt the Python statement to execute.
+        @param stmt Python statement to execute.
         @type str
         """
         self.debuggerInterface.remoteStatement(debuggerId, stmt.rstrip())
@@ -1408,7 +1414,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param line the new line, where execution should be continued to
+        @param line new line, where execution should be continued to
         @type int
         """
         self.debuggerInterface.remoteContinueUntil(debuggerId, line)
@@ -1419,7 +1425,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param line the new line, where execution should be continued
+        @param line new line, where execution should be continued
         @type int
         """
         self.debuggerInterface.remoteMoveIP(debuggerId, line)
@@ -1434,7 +1440,7 @@
         @type str
         @param fn filename the breakpoint belongs to
         @type str
-        @param line linenumber of the breakpoint
+        @param line line number of the breakpoint
         @type int
         @param setBreakpoint flag indicating setting or resetting a breakpoint
         @type bool
@@ -1455,7 +1461,7 @@
         @type str
         @param fn filename the breakpoint belongs to
         @type str
-        @param line linenumber of the breakpoint
+        @param line line number of the breakpoint
         @type int
         @param enable flag indicating enabling or disabling a breakpoint
         @type bool
@@ -1470,7 +1476,7 @@
         @type str
         @param fn filename the breakpoint belongs to
         @type str
-        @param line linenumber of the breakpoint
+        @param line line number of the breakpoint
         @type int
         @param count number of occurrences to ignore
         @type int
@@ -1528,7 +1534,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param inputString the raw input
+        @param inputString raw input
         @type str
         """
         self.debuggerInterface.remoteRawInput(debuggerId, inputString)
@@ -1569,7 +1575,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param scope the scope of the variables (0 = local, 1 = global)
+        @param scope scope of the variables (0 = local, 1 = global)
         @type int
         @param filterList list of variable types to filter out
         @type list of str
@@ -1588,7 +1594,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param scope the scope of the variables (0 = local, 1 = global)
+        @param scope scope of the variables (0 = local, 1 = global)
         @type int
         @param filterList list of variable types to filter out
         @type list of str
@@ -1621,7 +1627,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param scope the scope of the variables (0 = local, 1 = global)
+        @param scope scope of the variables (0 = local, 1 = global)
         @type int
         @param filterStr regexp string for variable names to filter out
         @type str
@@ -1658,7 +1664,7 @@
 
         @param debuggerId ID of the debugger backend
         @type str
-        @param text the text to be completed
+        @param text text to be completed
         @type str
         """
         self.debuggerInterface.remoteCompletion(debuggerId, text)

eric ide

mercurial