Debugger/DebuggerInterfacePython.py

changeset 4553
a6b2acd1a355
parent 4366
9445c7cb991f
child 4631
5c1a96925da4
--- a/Debugger/DebuggerInterfacePython.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Debugger/DebuggerInterfacePython.py	Sun Nov 08 17:01:39 2015 +0100
@@ -30,26 +30,6 @@
 
 
 ClientDefaultCapabilities = DebugClientCapabilities.HasAll
-    
-
-def getRegistryData():
-    """
-    Module function to get characterising data for the debugger interface.
-    
-    @return list of the following data. Client type (string), client
-        capabilities (integer), client type association (list of strings)
-    """
-    exts = []
-    for ext in Preferences.getDebugger("PythonExtensions").split():
-        if ext.startswith("."):
-            exts.append(ext)
-        else:
-            exts.append(".{0}".format(ext))
-    
-    if exts and Preferences.getDebugger("PythonInterpreter"):
-        return ["Python2", ClientDefaultCapabilities, exts]
-    else:
-        return ["", 0, []]
 
 
 class DebuggerInterfacePython(QObject):
@@ -1086,3 +1066,40 @@
             self.qsock.write(cmd.encode('utf8'))
         else:
             self.queue.append(cmd)
+    
+
+def createDebuggerInterfacePython(debugServer, passive):
+    """
+    Module function to create a debugger interface instance.
+    
+        
+    @param debugServer reference to the debug server
+    @type DebugServer
+    @param passive flag indicating passive connection mode
+    @type bool
+    @return instantiated debugger interface
+    @rtype DebuggerInterfacePython
+    """
+    return DebuggerInterfacePython(debugServer, passive)
+
+
+def getRegistryData():
+    """
+    Module function to get characterizing data for the debugger interface.
+    
+    @return tuple containing  client type, client capabilities, client file
+        type associations and reference to creation function
+    @rtype tuple of (str, int, list of str, function)
+    """
+    exts = []
+    for ext in Preferences.getDebugger("PythonExtensions").split():
+        if ext.startswith("."):
+            exts.append(ext)
+        else:
+            exts.append(".{0}".format(ext))
+    
+    if exts and Preferences.getDebugger("PythonInterpreter"):
+        return ["Python2", ClientDefaultCapabilities, exts,
+                createDebuggerInterfacePython]
+    else:
+        return ["", 0, [], None]

eric ide

mercurial