From 06caee41b87e5297d664e6a6c5da27f9251f4c09 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Wed, 18 May 2016 07:46:27 -0400 Subject: [PATCH] Clean up command_binding_completion. - Add a space after the comman for multiple binding suggestions. - Use defaultdict(list) instead of defaultdict(lambda: []) - Move the pylint comment back to the top of the class --- qutebrowser/completion/models/miscmodels.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/completion/models/miscmodels.py b/qutebrowser/completion/models/miscmodels.py index 917b09661..08cba8c58 100644 --- a/qutebrowser/completion/models/miscmodels.py +++ b/qutebrowser/completion/models/miscmodels.py @@ -33,11 +33,11 @@ class CommandCompletionModel(base.BaseCompletionModel): """A CompletionModel filled with all commands and descriptions.""" - COLUMN_WIDTHS = (20, 60, 20) - # https://github.com/The-Compiler/qutebrowser/issues/545 # pylint: disable=abstract-method + COLUMN_WIDTHS = (20, 60, 20) + def __init__(self, parent=None): super().__init__(parent) assert cmdutils.cmd_dict @@ -54,11 +54,11 @@ class CommandCompletionModel(base.BaseCompletionModel): # map each command to its bound keys and show these in the misc column keyconf = objreg.get('key-config') - cmd_to_keys = defaultdict(lambda: []) + cmd_to_keys = defaultdict(list) for key, cmd in keyconf.get_bindings_for('normal').items(): cmd_to_keys[cmd].append(key) for (name, desc) in sorted(cmdlist): - self.new_item(cat, name, desc, str.join(',', cmd_to_keys[name])) + self.new_item(cat, name, desc, str.join(', ', cmd_to_keys[name])) class HelpCompletionModel(base.BaseCompletionModel):