diff options
author | 2010-01-06 06:44:34 +0200 | |
---|---|---|
committer | 2010-01-06 06:44:34 +0200 | |
commit | e302b74a1bf6ff2edd2730bf32e1db28d7caff0a (patch) | |
tree | 1de88f97e6b3234004867dabc68d941841eae1bf /examples/data/uzbl/plugins/plugin_template.py | |
parent | b073f78bbcb1bbf7699707aa1381df78737b06fc (diff) | |
parent | f7608a8fc48ad98e6d7227c10cf3786e37c4a2ab (diff) |
Merge branch 'master' of git://github.com/Dieterbe/uzbl into follow
Diffstat (limited to 'examples/data/uzbl/plugins/plugin_template.py')
-rw-r--r-- | examples/data/uzbl/plugins/plugin_template.py | 25 |
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, + }) |