28 |
28 |
29 from eric6config import getConfig |
29 from eric6config import getConfig |
30 |
30 |
31 |
31 |
32 ClientDefaultCapabilities = DebugClientCapabilities.HasAll |
32 ClientDefaultCapabilities = DebugClientCapabilities.HasAll |
33 |
|
34 |
|
35 def getRegistryData(): |
|
36 """ |
|
37 Module function to get characterising data for the debugger interface. |
|
38 |
|
39 @return list of the following data. Client type (string), client |
|
40 capabilities (integer), client type association (list of strings) |
|
41 """ |
|
42 exts = [] |
|
43 for ext in Preferences.getDebugger("PythonExtensions").split(): |
|
44 if ext.startswith("."): |
|
45 exts.append(ext) |
|
46 else: |
|
47 exts.append(".{0}".format(ext)) |
|
48 |
|
49 if exts and Preferences.getDebugger("PythonInterpreter"): |
|
50 return ["Python2", ClientDefaultCapabilities, exts] |
|
51 else: |
|
52 return ["", 0, []] |
|
53 |
33 |
54 |
34 |
55 class DebuggerInterfacePython(QObject): |
35 class DebuggerInterfacePython(QObject): |
56 """ |
36 """ |
57 Class implementing the Python debugger interface for the debug server. |
37 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')) |
1066 self.qsock.write(cmd.encode('utf8')) |
1087 else: |
1067 else: |
1088 self.queue.append(cmd) |
1068 self.queue.append(cmd) |
|
1069 |
|
1070 |
|
1071 def createDebuggerInterfacePython(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 DebuggerInterfacePython(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("PythonExtensions").split(): |
|
1096 if ext.startswith("."): |
|
1097 exts.append(ext) |
|
1098 else: |
|
1099 exts.append(".{0}".format(ext)) |
|
1100 |
|
1101 if exts and Preferences.getDebugger("PythonInterpreter"): |
|
1102 return ["Python2", ClientDefaultCapabilities, exts, |
|
1103 createDebuggerInterfacePython] |
|
1104 else: |
|
1105 return ["", 0, [], None] |