From 7d9bd17aff97b8498de1a0f061359b6d39e774f3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 2 Aug 2014 16:15:59 +0200 Subject: [PATCH] Fix error message when executing command in wrong mode. --- qutebrowser/commands/command.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index 928a99704..983500d75 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -83,13 +83,13 @@ class Command: # of qutebrowser.keyinput.modeman. curmode = QCoreApplication.instance().modeman.mode if self.modes is not None and curmode not in self.modes: + mode_names = '/'.join(mode.name for mode in self.modes) raise PrerequisitesError("{}: This command is only allowed in {} " - "mode.".format(self.name, - '/'.join(self.modes))) + "mode.".format(self.name, mode_names)) elif self.not_modes is not None and curmode in self.not_modes: + mode_names = '/'.join(mode.name for mode in self.not_modes) raise PrerequisitesError("{}: This command is not allowed in {} " - "mode.".format(self.name, - '/'.join(self.not_modes))) + "mode.".format(self.name, mode_names)) if self.needs_js and not QWebSettings.globalSettings().testAttribute( QWebSettings.JavascriptEnabled): raise PrerequisitesError("{}: This command needs javascript "