diff options
author | Mason Larobina <mason.larobina@gmail.com> | 2009-11-19 20:39:18 +0800 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2009-11-19 20:39:18 +0800 |
commit | d23d26b84d76dcd0839d55602345e72a297d0049 (patch) | |
tree | b77b6cdc9e722c46b6909324d7354bebf411f376 /examples/data/uzbl/plugins/keycmd.py | |
parent | 00f7036a0134792e83bb7ebce0724be0ac1175a3 (diff) |
General bugfixes in the bind plugin.
1. Use sets in the keycmd plugin for the held list.
2. Remove the bind filter function in the bind plugin.
3. Compare the mod_cmd and keylet.held sets instead of using a string
comparison to determine if the user is holding down the correct modkeys
for any given bind.
4. Raise exceptions instead of printing errors in the bind plugin.
5. Raise the builtin SyntaxError exception for parsing failures.
Diffstat (limited to 'examples/data/uzbl/plugins/keycmd.py')
-rw-r--r-- | examples/data/uzbl/plugins/keycmd.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/data/uzbl/plugins/keycmd.py b/examples/data/uzbl/plugins/keycmd.py index 8961f74..976eee7 100644 --- a/examples/data/uzbl/plugins/keycmd.py +++ b/examples/data/uzbl/plugins/keycmd.py @@ -31,7 +31,7 @@ class Keylet(object): def __init__(self): # Modcmd tracking - self.held = [] + self.held = set() self.modcmd = '' self.is_modcmd = False @@ -169,7 +169,7 @@ def clear_modcmd(uzbl, clear_held=False): k.is_modcmd = False k._repr_cache = False if clear_held: - k.held = [] + k.held = set() config = uzbl.get_config() if 'modcmd' not in config or config['modcmd'] != '': @@ -271,8 +271,7 @@ def key_press(uzbl, key): k.held.remove('Tab') if key not in k.held: - k.held.append(key) - k.held.sort() + k.held.add(key) else: k.is_modcmd = True |