OSDN Git Service

Allow plugins to bind scripts which are executed globally and take precedence over...
authorJames Teh <jamie@jantrid.net>
Mon, 29 Nov 2010 00:50:57 +0000 (10:50 +1000)
committerJames Teh <jamie@jantrid.net>
Mon, 29 Nov 2010 00:50:57 +0000 (10:50 +1000)
source/scriptHandler.py

index ea99d40..50ae05b 100644 (file)
@@ -12,6 +12,7 @@ import api
 import queueHandler\r
 from logHandler import log\r
 import inputCore\r
+import pluginHandler\r
 \r
 _numScriptsQueued=0 #Number of scripts that are queued to be executed\r
 _lastScriptTime=0 #Time in MS of when the last script was executed\r
@@ -43,6 +44,12 @@ def findScript(gesture):
                for identifier in gesture.identifiers:\r
                        globalMapScripts.extend(globalMap.getScriptsForGesture(identifier))\r
 \r
+       # Plugin level.\r
+       for plugin in pluginHandler.runningPlugins:\r
+               func = _getObjScript(plugin, gesture, globalMapScripts)\r
+               if func:\r
+                       return func\r
+\r
        # App module level.\r
        app = focus.appModule\r
        if app:\r