diff options
author | Mason Larobina <mason.larobina@gmail.com> | 2010-03-08 17:40:47 +0800 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2010-03-08 17:40:47 +0800 |
commit | e1cc27677b92c5ce520c692566fd38420b70b3c7 (patch) | |
tree | 5e2c009cb24974bd46d001a1e0136c4a27dc7234 /examples/data/scripts/uzbl-event-manager | |
parent | c3c63b671d0ae706512fe196b1eb1cc79a2950c9 (diff) |
Use itertools.count instead of custom counter function.
Diffstat (limited to 'examples/data/scripts/uzbl-event-manager')
-rwxr-xr-x | examples/data/scripts/uzbl-event-manager | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/examples/data/scripts/uzbl-event-manager b/examples/data/scripts/uzbl-event-manager index a0afcb3..a3fed98 100755 --- a/examples/data/scripts/uzbl-event-manager +++ b/examples/data/scripts/uzbl-event-manager @@ -39,6 +39,7 @@ from signal import signal, SIGTERM from optparse import OptionParser from traceback import print_exc from functools import partial +from itertools import count def xdghome(key, default): @@ -107,15 +108,6 @@ def error(msg): sys.stderr.write("%s: error: %s\n" % (SCRIPTNAME, msg)) -def counter(): - '''Generate unique object id's.''' - - i = 0 - while True: - i += 1 - yield i - - def find_plugins(plugin_dirs): '''Find all event manager plugins in the plugin dirs and return a dictionary of {'plugin-name.py': '/full/path/to/plugin-name.py', ...}''' @@ -322,7 +314,7 @@ def parse_msg(uzbl, msg): class EventHandler(object): - nexthid = counter().next + nexthid = count().next def __init__(self, event, handler, *args, **kargs): if not callable(handler): |