|
Module globalPluginHandler
|
|
1
2
3
4
5
6
7 import sys
8 import pkgutil
9 import config
10 import baseObject
11 from logHandler import log
12 import globalPlugins
13
14
15 runningPlugins = set()
16
18 for loader, name, isPkg in pkgutil.iter_modules(globalPlugins.__path__):
19 if name.startswith("_"):
20 continue
21 try:
22 plugin = __import__("globalPlugins.%s" % name, globals(), locals(), ("globalPlugins",)).GlobalPlugin
23 except:
24 log.error("Error importing global plugin %s" % name, exc_info=True)
25 continue
26 yield plugin
27
35
43
55
57 """Base global plugin.
58 Global plugins facilitate the implementation of new global commands,
59 support for objects which may be found across many applications, etc.
60 Each global plugin should be a separate Python module in the globalPlugins package containing a C{GlobalPlugin} class which inherits from this base class.
61 Global plugins can implement and bind gestures to scripts which will take effect at all times.
62 See L{ScriptableObject} for details.
63 Global plugins can also receive NVDAObject events for all NVDAObjects.
64 This is done by implementing methods called C{event_eventName},
65 where C{eventName} is the name of the event; e.g. C{event_gainFocus}.
66 These event methods take two arguments: the NVDAObject on which the event was fired
67 and a callable taking no arguments which calls the next event handler.
68 """
69
71 """Terminate this global plugin.
72 This will be called when NVDA is finished with this global plugin.
73 """
74
76 """Choose NVDAObject overlay classes for a given NVDAObject.
77 This is called when an NVDAObject is being instantiated after L{NVDAObjects.NVDAObject.findOverlayClasses} has been called on the API-level class.
78 This allows a global plugin to add or remove overlay classes.
79 See L{NVDAObjects.NVDAObject.findOverlayClasses} for details about overlay classes.
80 @param obj: The object being created.
81 @type obj: L{NVDAObjects.NVDAObject}
82 @param clsList: The list of classes, which will be modified by this method if appropriate.
83 @type clsList: list of L{NVDAObjects.NVDAObject}
84 """
85