diff options
author | 2010-03-08 17:40:47 +0800 | |
---|---|---|
committer | 2010-03-12 13:04:38 +0800 | |
commit | 2d9eafcb87bb77b4f9a1f346c97b5d1d86709064 (patch) | |
tree | ac67f6e6004b1b68b86690b0fd5a8dc6f08ad768 | |
parent | 38483db82c788368b8faaf0ed4ac4becdb4f8b37 (diff) |
Use itertools.count instead of custom counter function.
-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): |