From f828e554f70f02e2b4e2ffc504239d75db810658 Mon Sep 17 00:00:00 2001 From: Peter Vilim Date: Tue, 6 Jan 2015 04:03:21 -0600 Subject: [PATCH] misc fixes --- qutebrowser/config/configtypes.py | 17 ++++++++--------- qutebrowser/mainwindow/mainwindow.py | 6 +++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 3c85d7859..1e27b1082 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1246,22 +1246,22 @@ class ConfirmQuit(List): raise configexc.ValidationError(value, "List cannot contain never!") # Always can't be set with other options elif 'always' in values and len(values) > 1: - raise configexc.ValidationError(value, - "List cannot contain always!") + raise configexc.ValidationError( + value, "List cannot contain always!") # Values have to be valid elif not set(values).issubset(set(self.valid_values.values)): - raise configexc.ValidationError(value, "List contains invalid" - " values!") + raise configexc.ValidationError( + value, "List contains invalid values!") # List can't have duplicates elif len(set(values)) != len(values): - raise configexc.ValidationError(value, "List contains duplicate" - " values!") + raise configexc.ValidationError( + value, "List contains duplicate values!") def complete(self): combinations = [] # Generate combinations of the options that can be combined for size in range(2, len(self.combinable_values) + 1): - combinations = combinations + list( + combinations += list( itertools.combinations(self.combinable_values, size)) out = [] # Add valid single values @@ -1270,8 +1270,7 @@ class ConfirmQuit(List): # Add combinations to list of options for val in combinations: desc = '' - val = ','.join(val) - out.append((val, desc)) + out.append((','.join(val), desc)) return out diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 6c482e34b..c5a0b00a9 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -332,8 +332,8 @@ class MainWindow(QWidget): window=self.win_id) download_count = download_manager.rowCount() quit_texts = [] - # Close if set to never ask for confirmation (backward compatible) - if confirm_quit == 'never' or 'never' in confirm_quit: + # Close if set to never ask for confirmation + if 'never' in confirm_quit: pass # Ask if multiple-tabs are open if 'multiple-tabs' in confirm_quit and tab_count > 1: @@ -352,7 +352,7 @@ class MainWindow(QWidget): default=True) # Stop asking if the user cancels if not confirmed: - log.destroy.debug("Cancelling losing of window {}".format( + log.destroy.debug("Cancelling closing of window {}".format( self.win_id)) e.ignore() return