diff -r fd1262c3fa79 -r 56388f41b1e6 Debugger/DebugServer.py --- a/Debugger/DebugServer.py Fri Aug 25 16:14:48 2017 +0200 +++ b/Debugger/DebugServer.py Sat Aug 26 16:49:16 2017 +0200 @@ -30,6 +30,8 @@ import Utilities +# TODO: change this to a list of debugger interfaces and unite the two Python +# variants because they are nearly identical DebuggerInterfaces = { "Python2": "DebuggerInterfacePython2", "Python3": "DebuggerInterfacePython3", @@ -292,6 +294,8 @@ """ Public slot to handle the preferencesChanged signal. """ + # TODO: just build a set of registry data functions and call + # registerDebuggerInterface with each of them registeredInterfaces = {} for language in self.__debuggerInterfaceRegistry: registeredInterfaces[language] = \ @@ -315,6 +319,8 @@ to create the debugger interface (see __createDebuggerInterface()) @type function """ + # TODO: remove the 'name' parameter and move the check below against + # clientLanguage if name in self.__debuggerInterfaceRegistry: E5MessageBox.warning( None, @@ -323,6 +329,7 @@ """ been registered. Ignoring this request.</p>""")) return + # TODO: change getRegistryData to return a list of registry entries clientLanguage, clientCapabilities, clientExtensions, \ interfaceCreator = getRegistryData() if clientLanguage: @@ -337,6 +344,7 @@ @param name name of the debugger interface @type str """ + # TODO: change name to a list of names if name in self.__debuggerInterfaceRegistry: del self.__debuggerInterfaceRegistry[name] @@ -359,6 +367,7 @@ """ Private method to register the available internal debugger interfaces. """ + # TODO: apply DebuggerInterfaces being a list for name, interface in DebuggerInterfaces.items(): modName = "Debugger.{0}".format(interface) mod = __import__(modName) @@ -366,6 +375,7 @@ for comp in components[1:]: mod = getattr(mod, comp) + # TODO: remove name parameter self.registerDebuggerInterface(name, mod.getRegistryData) def getSupportedLanguages(self, shellOnly=False):