DebugClients/Python/DebugClientBase.py

changeset 5587
ea526b78ee6c
parent 5551
16f9a0bccda1
child 5590
40e18a10d837
child 5594
6e477a8e990c
diff -r 0e5421d679e7 -r ea526b78ee6c DebugClients/Python/DebugClientBase.py
--- a/DebugClients/Python/DebugClientBase.py	Tue Mar 07 18:46:09 2017 +0100
+++ b/DebugClients/Python/DebugClientBase.py	Tue Mar 07 18:53:18 2017 +0100
@@ -292,12 +292,12 @@
         """
         return eval(self.raw_input(prompt, True))
         
-    def sessionClose(self, exit=True):
+    def sessionClose(self, terminate=True):
         """
         Public method to close the session with the debugger and optionally
         terminate.
         
-        @param exit flag indicating to terminate (boolean)
+        @param terminate flag indicating to terminate (boolean)
         """
         try:
             self.set_quit()
@@ -313,7 +313,7 @@
         self.writestream.close(True)
         self.errorstream.close(True)
 
-        if exit:
+        if terminate:
             # Ok, go away.
             sys.exit()
 
@@ -1320,14 +1320,14 @@
         # reset coding
         self.__coding = self.defaultCoding
 
-    def __dumpVariables(self, frmnr, scope, filter):
+    def __dumpVariables(self, frmnr, scope, filterList):
         """
         Private method to return the variables of a frame to the debug server.
         
         @param frmnr distance of frame reported on. 0 is the current frame
             (int)
         @param scope 1 to report global variables, 0 for local variables (int)
-        @param filter the indices of variable types to be filtered
+        @param filterList the indices of variable types to be filtered
             (list of int)
         """
         if self.currentThread is None:
@@ -1345,22 +1345,23 @@
         
         if f is None:
             if scope:
-                dict = self.debugMod.__dict__
+                varDict = self.debugMod.__dict__
             else:
                 scope = -1
         elif scope:
-            dict = f.f_globals
+            varDict = f.f_globals
         elif f.f_globals is f.f_locals:
                 scope = -1
         else:
-            dict = f.f_locals
+            varDict = f.f_locals
             
         varlist = []
         
         if scope != -1:
-            keylist = dict.keys()
+            keylist = varDict.keys()
             
-            vlist = self.__formatVariablesList(keylist, dict, scope, filter)
+            vlist = self.__formatVariablesList(
+                keylist, varDict, scope, filterList)
             varlist.extend(vlist)
         
         self.sendJsonCommand("ResponseVariables", {
@@ -1368,7 +1369,7 @@
             "variables": varlist,
         })
     
-    def __dumpVariable(self, var, frmnr, scope, filter):
+    def __dumpVariable(self, var, frmnr, scope, filterList):
         """
         Private method to return the variables of a frame to the debug server.
         
@@ -1377,7 +1378,7 @@
         @param frmnr distance of frame reported on. 0 is the current frame
             (int)
         @param scope 1 to report global variables, 0 for local variables (int)
-        @param filter the indices of variable types to be filtered
+        @param filterList the indices of variable types to be filtered
             (list of int)
         """
         if self.currentThread is None:
@@ -1392,20 +1393,20 @@
         
         if f is None:
             if scope:
-                dict = self.debugMod.__dict__
+                varDict = self.debugMod.__dict__
             else:
                 scope = -1
         elif scope:
-            dict = f.f_globals
+            varDict = f.f_globals
         elif f.f_globals is f.f_locals:
                 scope = -1
         else:
-            dict = f.f_locals
+            varDict = f.f_locals
         
         varlist = []
         
         if scope != -1:
-            variable = dict
+            variable = varDict
             for attribute in var:
                 attribute = self.__extractIndicators(attribute)[0]
                 typeObject, typeName, typeStr, resolver = \
@@ -1425,9 +1426,9 @@
                     vlist = self.__formatQtVariable(variable, typeName)
                     varlist.extend(vlist)
                 elif resolver:
-                    dict = resolver.getDictionary(variable)
+                    varDict = resolver.getDictionary(variable)
                     vlist = self.__formatVariablesList(
-                        list(dict.keys()), dict, scope, filter)
+                        list(dict.keys()), varDict, scope, filterList)
                     varlist.extend(vlist)
         
         self.sendJsonCommand("ResponseVariable", {
@@ -1597,7 +1598,7 @@
             
         return varlist
     
-    def __formatVariablesList(self, keylist, dict_, scope, filter=[],
+    def __formatVariablesList(self, keylist, dict_, scope, filterList=[],
                               formatSequences=False):
         """
         Private method to produce a formated variables list.
@@ -1614,9 +1615,9 @@
             filter (int).
             Variables are only added to the list, if their name do not match
             any of the filter expressions.
-        @param filter the indices of variable types to be filtered. Variables
-            are only added to the list, if their type is not contained in the
-            filter list.
+        @param filterList the indices of variable types to be filtered.
+            Variables are only added to the list, if their type is not
+            contained in the filter list.
         @param formatSequences flag indicating, that sequence or dictionary
             variables should be formatted. If it is 0 (or false), just the
             number of items contained in these variables is returned. (boolean)
@@ -1641,7 +1642,7 @@
                 continue
             
             # filter hidden attributes (filter #0)
-            if 0 in filter and str(key)[:2] == '__' and not (
+            if 0 in filterList and str(key)[:2] == '__' and not (
                 key == "___len___" and
                     DebugVariables.TooLargeAttribute in keylist):
                 continue
@@ -1658,19 +1659,19 @@
                 valtypename = type(value).__name__
                 if valtype not in ConfigVarTypeStrings:
                     if valtype in ["numpy.ndarray", "array.array"]:
-                        if ConfigVarTypeStrings.index('list') in filter:
+                        if ConfigVarTypeStrings.index('list') in filterList:
                             continue
                     elif valtypename == "MultiValueDict":
-                        if ConfigVarTypeStrings.index('dict') in filter:
+                        if ConfigVarTypeStrings.index('dict') in filterList:
                             continue
                     elif valtype == "sip.methoddescriptor":
                         if ConfigVarTypeStrings.index(
-                                'method') in filter:
+                                'method') in filterList:
                             continue
                     elif valtype == "sip.enumtype":
-                        if ConfigVarTypeStrings.index('class') in filter:
+                        if ConfigVarTypeStrings.index('class') in filterList:
                             continue
-                    elif ConfigVarTypeStrings.index('instance') in filter:
+                    elif ConfigVarTypeStrings.index('instance') in filterList:
                         continue
                     
                     if (not valtypestr.startswith('type ') and
@@ -1683,22 +1684,24 @@
                         if valtype == "instancemethod":
                             valtype = "method"
                         
-                        if ConfigVarTypeStrings.index(valtype) in filter:
+                        if ConfigVarTypeStrings.index(valtype) in filterList:
                             continue
                     except ValueError:
                         if valtype == "classobj":
                             if ConfigVarTypeStrings.index(
-                                    'instance') in filter:
+                                    'instance') in filterList:
                                 continue
                         elif valtype == "sip.methoddescriptor":
                             if ConfigVarTypeStrings.index(
-                                    'method') in filter:
+                                    'method') in filterList:
                                 continue
                         elif valtype == "sip.enumtype":
-                            if ConfigVarTypeStrings.index('class') in filter:
+                            if ConfigVarTypeStrings.index('class') in \
+                                    filterList:
                                 continue
                         elif not valtype.startswith("PySide") and \
-                                ConfigVarTypeStrings.index('other') in filter:
+                            (ConfigVarTypeStrings.index('other') in
+                             filterList):
                             continue
                 
                 try:

eric ide

mercurial