diff --git a/addon/globalPlugins/webAccess/__init__.py b/addon/globalPlugins/webAccess/__init__.py index af3c262b..2efebe2f 100644 --- a/addon/globalPlugins/webAccess/__init__.py +++ b/addon/globalPlugins/webAccess/__init__.py @@ -268,118 +268,6 @@ def script_showWebAccessSettings(self, gesture): # @UnusedVariable category=SCRIPT_CATEGORY, gesture="kb:nvda+control+shift+w" ) - def script_debugWebModule(self, gesture): # @UnusedVariable - global activeWebApp - focus = api.getFocusObject() - if \ - activeWebApp is None \ - and not hasattr(focus, "_webApp") \ - and not hasattr(focus, "treeInterceptor") \ - and not hasattr(focus.treeInterceptor, "_webApp") \ - and not hasattr(focus.treeInterceptor, "nodeManager"): - ui.message("Pas de WebModule actif") - return - - diverged = False - focusModule = None - treeModule = None - msg = "Divergence :" - msg += os.linesep - msg += "activeWebApp = {webModule}".format( - webModule=activeWebApp.storeRef - if hasattr(activeWebApp, "storeRef") - else activeWebApp - ) - if activeWebApp is not None: - msg += " ({id})".format(id=id(activeWebApp)) - if not hasattr(focus, "_webApp"): - msg += os.linesep - msg += "focus._webApp absent" - else: - focusModule = focus._webApp - if activeWebApp is not focusModule: - diverged = True - msg += os.linesep - msg += "focus._webApp = {webModule}".format( - webModule= - focusModule.storeRef - if hasattr(focusModule, "storeRef") - else focusModule - ) - if focusModule is not None: - msg += " ({id})".format(id=id(focusModule)) - if not hasattr(focus, "treeInterceptor"): - diverged = True - msg += os.linesep - msg += "focus.treeInterceptor absent" - else: - if focus.treeInterceptor is None: - diverged = True - msg += os.linesep - msg += "focus.treeInterceptor None" -# if not hasattr(focusModule, "treeInterceptor"): -# diverged = True -# msg += os.linesep -# msg += u"focus._webApp.treeInterceptor absent" -# elif focusModule.treeInterceptor is None: -# diverged = True -# msg += os.linesep -# msg += u"focus._webApp.treeInterceptor None" -# elif focus.treeInterceptor is not focusModule.treeInterceptor: -# diverged = True -# msg += os.linesep -# msg += u"TreeInterceptors différents" - if hasattr(focus.treeInterceptor, "_webApp"): - treeModule = focus.treeInterceptor._webApp - if \ - treeModule is not focusModule \ - or treeModule is not activeWebApp: - diverged = True - msg += os.linesep - msg += "treeInterceptor._webApp = {webModule}".format( - webModule= - treeModule.storeRef - if hasattr(treeModule, "storeRef") - else treeModule - ) - if treeModule is not None: - msg += " ({id})".format(id=id(treeModule)) - if hasattr(focus.treeInterceptor, "nodeManager"): - if focusModule is None: - diverged = True - msg += "treeInterceptor.nodeManager " - if focus.treeInterceptor.nodeManager is None: - msg += "est None" - else: - msg += "n'est pas None" - elif \ - focusModule.ruleManager.nodeManager is not \ - focus.treeInterceptor.nodeManager: - diverged = True - msg += os.linesep - msg += "NodeManagers différents" - elif focusModule.ruleManager.nodeManager is None: - msg += os.linesep - msg += "NodeManagers None" - - - allMsg = "" - - if not diverged: - try: - from six import text_type - except ImportError: - # NVDA version < 2018.3 - text_type = str - msg = text_type(focusModule.storeRef) - speech.speakMessage(msg) - allMsg += msg + os.linesep - - treeInterceptor = html.getTreeInterceptor() - msg = "nodeManager %d caractères, %s, %s" % (treeInterceptor.nodeManager.treeInterceptorSize, treeInterceptor.nodeManager.isReady, treeInterceptor.nodeManager.mainNode is not None) - speech.speakMessage(msg) - allMsg += msg + os.linesep - api.copyToClip(allMsg) @script( # Translators: Input help mode message for show Web Access menu command. diff --git a/addon/globalPlugins/webAccess/webAppScheduler.py b/addon/globalPlugins/webAccess/webAppScheduler.py index a3039ee8..269d3c1e 100644 --- a/addon/globalPlugins/webAccess/webAppScheduler.py +++ b/addon/globalPlugins/webAccess/webAppScheduler.py @@ -22,7 +22,12 @@ # Get ready for Python 3 -__author__ = "Frédéric Brugnot " +__authors__ = ( + "Frédéric Brugnot ", + "Julien Cochuyt ", + "André-Abush Clause ", + "Gatien Bouyssou ", +) import threading @@ -130,29 +135,6 @@ def event_treeInterceptor_gainFocus(self, treeInterceptor, firstGainFocus): #browseMode.reportPassThrough(treeInterceptor) self.send(eventName="updateNodeManager", treeInterceptor=treeInterceptor) - def event_checkWebAppManager(self): - # TODO: Should not be triggered anymore - log.error("event_checkWebAppManager") - focus = api.getFocusObject() - webApp = focus.webAccess.webModule if isinstance(focus, WebAccessObject) else None - TRACE("event_checkWebAppManager: webApp={webApp}".format( - webApp=id(webApp) if webApp is not None else None - )) - if webApp: - treeInterceptor = focus.treeInterceptor - if treeInterceptor: - #webApp.treeInterceptor = treeInterceptor - nodeManager = getattr(treeInterceptor, "nodeManager", None) - TRACE( - "event_checkWebAppManager: " - "nodeManager={nodeManager}".format( - nodeManager=id(nodeManager) - if nodeManager is not None else None - ) - ) - if nodeManager: - webApp.markerManager.update(nodeManager) - def event_updateNodeManager(self, treeInterceptor): if not ( isinstance(treeInterceptor, WebAccessBmdti) diff --git a/addon/globalPlugins/webAccess/webModuleHandler/webModule.py b/addon/globalPlugins/webAccess/webModuleHandler/webModule.py index 9177cc47..21de1f58 100644 --- a/addon/globalPlugins/webAccess/webModuleHandler/webModule.py +++ b/addon/globalPlugins/webAccess/webModuleHandler/webModule.py @@ -280,10 +280,6 @@ def _setLayeredProperty(self, name, value): layer.dirty = True data["overrides"][name] = overridden - def event_webApp_init(self, obj, nextHandler): - self.loadUserFile() - nextHandler() - def event_webApp_pageChanged(self, pageTitle, nextHandler): speech.cancelSpeech() playWebAppSound("pageChanged")