aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/uzbl/plugins/plugin_template.py
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2010-01-02 19:02:03 +0100
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2010-01-02 19:02:03 +0100
commit02995443bc8af38fc3bb3896c8d32eb0adc142d0 (patch)
tree1aa3e26476b7f581f23c0ae6e17870967c3563d1 /examples/data/uzbl/plugins/plugin_template.py
parent30b7d1630e487f01f0f2ddc0fffca9d492213619 (diff)
parenta5f014de5f76169a38ee67e46a0526e5d80a3433 (diff)
merge in changes from master
Diffstat (limited to 'examples/data/uzbl/plugins/plugin_template.py')
-rw-r--r--examples/data/uzbl/plugins/plugin_template.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/examples/data/uzbl/plugins/plugin_template.py b/examples/data/uzbl/plugins/plugin_template.py
index 03cb748..565a999 100644
--- a/examples/data/uzbl/plugins/plugin_template.py
+++ b/examples/data/uzbl/plugins/plugin_template.py
@@ -1,8 +1,5 @@
'''Plugin template.'''
-# A list of functions this plugin exports to be used via uzbl object.
-__export__ = ['myplugin_function',]
-
# Holds the per-instance data dict.
UZBLS = {}
@@ -60,16 +57,20 @@ def init(uzbl):
# Make a dictionary comprising of {"EVENT_NAME": handler, ..} to the event
# handler stack:
- connects = {
- 'INSTANCE_START': add_instance,
- 'INSTANCE_EXIT': del_instance,
- 'MYPLUGIN_EVENT': myplugin_event_parser,
- }
-
- # And connect the dicts event handlers to the handler stack.
- uzbl.connect_dict(connects)
+ uzbl.connect_dict({
+ # event name function
+ 'INSTANCE_START': add_instance,
+ 'INSTANCE_EXIT': del_instance,
+ 'MYPLUGIN_EVENT': myplugin_event_parser,
+ })
# Or connect a handler to an event manually and supply additional optional
# arguments:
-
#uzbl.connect("MYOTHER_EVENT", myother_event_parser, True, limit=20)
+
+ # Function exports to the uzbl object, `function(uzbl, *args, ..)`
+ # becomes `uzbl.function(*args, ..)`.
+ uzbl.connect_dict({
+ # external name function
+ 'myplugin_function': myplugin_function,
+ })