Debugger/DebuggerInterfacePython3.py

changeset 4553
a6b2acd1a355
parent 4366
9445c7cb991f
child 4631
5c1a96925da4
equal deleted inserted replaced
4552:b1ea4ea0190e 4553:a6b2acd1a355
27 27
28 from eric6config import getConfig 28 from eric6config import getConfig
29 29
30 30
31 ClientDefaultCapabilities = DebugClientCapabilities.HasAll 31 ClientDefaultCapabilities = DebugClientCapabilities.HasAll
32
33
34 def getRegistryData():
35 """
36 Module function to get characterising data for the debugger interface.
37
38 @return list of the following data. Client type (string), client
39 capabilities (integer), client type association (list of strings)
40 """
41 exts = []
42 for ext in Preferences.getDebugger("Python3Extensions").split():
43 if ext.startswith("."):
44 exts.append(ext)
45 else:
46 exts.append(".{0}".format(ext))
47
48 if exts:
49 return ["Python3", ClientDefaultCapabilities, exts]
50 else:
51 return ["", 0, []]
52 32
53 33
54 class DebuggerInterfacePython3(QObject): 34 class DebuggerInterfacePython3(QObject):
55 """ 35 """
56 Class implementing the Python debugger interface for the debug server. 36 Class implementing the Python debugger interface for the debug server.
1084 """ 1064 """
1085 if self.qsock is not None: 1065 if self.qsock is not None:
1086 self.qsock.write(cmd.encode('utf8', 'backslashreplace')) 1066 self.qsock.write(cmd.encode('utf8', 'backslashreplace'))
1087 else: 1067 else:
1088 self.queue.append(cmd) 1068 self.queue.append(cmd)
1069
1070
1071 def createDebuggerInterfacePython3(debugServer, passive):
1072 """
1073 Module function to create a debugger interface instance.
1074
1075
1076 @param debugServer reference to the debug server
1077 @type DebugServer
1078 @param passive flag indicating passive connection mode
1079 @type bool
1080 @return instantiated debugger interface
1081 @rtype DebuggerInterfacePython
1082 """
1083 return DebuggerInterfacePython3(debugServer, passive)
1084
1085
1086 def getRegistryData():
1087 """
1088 Module function to get characterizing data for the debugger interface.
1089
1090 @return tuple containing client type, client capabilities, client file
1091 type associations and reference to creation function
1092 @rtype tuple of (str, int, list of str, function)
1093 """
1094 exts = []
1095 for ext in Preferences.getDebugger("Python3Extensions").split():
1096 if ext.startswith("."):
1097 exts.append(ext)
1098 else:
1099 exts.append(".{0}".format(ext))
1100
1101 if exts:
1102 return ["Python3", ClientDefaultCapabilities, exts,
1103 createDebuggerInterfacePython3]
1104 else:
1105 return ["", 0, [], None]

eric ide

mercurial