From 2b74e733ba85215d8256c7dd573e16a6957196e5 Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Wed, 11 Nov 2009 20:01:34 +0800 Subject: Remove useless event manager imports. --- examples/data/uzbl/plugins/bind.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'examples/data/uzbl/plugins/bind.py') diff --git a/examples/data/uzbl/plugins/bind.py b/examples/data/uzbl/plugins/bind.py index b8494fe..89b0831 100644 --- a/examples/data/uzbl/plugins/bind.py +++ b/examples/data/uzbl/plugins/bind.py @@ -11,7 +11,6 @@ And it is also possible to execute a function on activation: import sys import re -from event_manager import config, counter, iscallable, isiterable # Export these variables/functions to uzbl. __export__ = ['bind', 'del_bind', 'del_bind_by_glob', 'get_binds'] @@ -31,11 +30,6 @@ class BindParseError(Exception): pass -def echo(msg): - if config['verbose']: - print 'bind plugin:', msg - - def error(msg): sys.stderr.write('bind plugin: error: %s\n' % msg) @@ -132,10 +126,11 @@ def del_bind_by_glob(uzbl, glob): class Bind(object): - nextbid = counter().next + # Class attribute to hold the number of Bind classes created. + counter = [0,] def __init__(self, glob, handler, *args, **kargs): - self.is_callable = iscallable(handler) + self.is_callable = callable(handler) self._repr_cache = None if not glob: @@ -149,14 +144,17 @@ class Bind(object): elif kargs: raise ArgumentError('cannot supply kargs for uzbl commands') - elif isiterable(handler): + elif hasattr(handler, '__iter__'): self.commands = handler else: self.commands = [handler,] + list(args) self.glob = glob - self.bid = self.nextbid() + + # Assign unique id. + self.counter[0] += 1 + self.bid = self.counter[0] self.split = split = find_prompts(glob) self.prompts = [] -- cgit v1.2.3