diff options
author | mathieui <mathieui@mathieui.net> | 2015-04-13 14:31:35 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-04-13 14:31:35 +0200 |
commit | 83113d42fce13e46ccc4783dc8ddc6cc97b1fd94 (patch) | |
tree | e88f9928f2e20dca5222590d933050fea69b2ffe /src/core/commands.py | |
parent | c8caccc9a1c33bd00693e7c33ae82db11dc6001f (diff) | |
download | poezio-83113d42fce13e46ccc4783dc8ddc6cc97b1fd94.tar.gz poezio-83113d42fce13e46ccc4783dc8ddc6cc97b1fd94.tar.bz2 poezio-83113d42fce13e46ccc4783dc8ddc6cc97b1fd94.tar.xz poezio-83113d42fce13e46ccc4783dc8ddc6cc97b1fd94.zip |
Add a "." shortcut to /set in order to set the section for the current tab JID
e.g. /set . notify_messages false would set the option for a section
named after the current tab.
Diffstat (limited to 'src/core/commands.py')
-rw-r--r-- | src/core/commands.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/commands.py b/src/core/commands.py index c0de8a03..338590f1 100644 --- a/src/core/commands.py +++ b/src/core/commands.py @@ -603,7 +603,15 @@ def command_set(self, args): plugin_config = self.plugin_manager.plugins[plugin_name].config info = plugin_config.set_and_save(option, value, section) else: - section = args[0] + if args[0] == '.': + name = safeJID(self.current_tab().name).bare + if not name: + self.information(_('Invalid tab to use the "." argument.'), + _('Error')) + return + section = name + else: + section = args[0] option = args[1] value = args[2] info = config.set_and_save(option, value, section) |