From f9734cde5623aaf701e222b00d5eebdf7a152772 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 20 Oct 2014 21:04:14 +0200 Subject: Remove the (sometimes wrong) default values in the config.get() calls --- src/core/completions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/completions.py') diff --git a/src/core/completions.py b/src/core/completions.py index f8fb7fc8..ca0bb41e 100644 --- a/src/core/completions.py +++ b/src/core/completions.py @@ -46,7 +46,7 @@ def completion_presence(self, the_input): def completion_theme(self, the_input): """ Completion for /theme""" - themes_dir = config.get('themes_dir', '') + themes_dir = config.get('themes_dir') themes_dir = themes_dir or\ os.path.join(os.environ.get('XDG_DATA_HOME') or\ os.path.join(os.environ.get('HOME'), '.local', 'share'), @@ -190,7 +190,7 @@ def completion_bookmark(self, the_input): tab = self.get_tab_by_name(jid.bare, tabs.MucTab) nicks = [tab.own_nick] if tab else [] default = os.environ.get('USER') if os.environ.get('USER') else 'poezio' - nick = config.get('default_nick', '') + nick = config.get('default_nick') if not nick: if not default in nicks: nicks.append(default) @@ -371,7 +371,7 @@ def completion_bookmark_local(self, the_input): tab = self.get_tab_by_name(jid.bare, tabs.MucTab) nicks = [tab.own_nick] if tab else [] default = os.environ.get('USER') if os.environ.get('USER') else 'poezio' - nick = config.get('default_nick', '') + nick = config.get('default_nick') if not nick: if not default in nicks: nicks.append(default) -- cgit v1.2.3 From 616d0d2c7301f5e287fb7daf24a835f8dbf250ba Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 29 Oct 2014 23:28:20 +0100 Subject: Fix two potential tracebacks on /set completion --- src/core/completions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/completions.py') diff --git a/src/core/completions.py b/src/core/completions.py index ca0bb41e..bc21a6c0 100644 --- a/src/core/completions.py +++ b/src/core/completions.py @@ -324,7 +324,7 @@ def completion_set(self, the_input): if '|' in args[1]: plugin_name, section = args[1].split('|')[:2] if not plugin_name in self.plugin_manager.plugins: - return the_input.auto_completion([''], n, quotify=True) + return the_input.new_completion([''], n, quotify=True) plugin = self.plugin_manager.plugins[plugin_name] end_list = plugin.config.options(section or plugin_name) elif not config.has_option('Poezio', args[1]): @@ -339,7 +339,7 @@ def completion_set(self, the_input): if '|' in args[1]: plugin_name, section = args[1].split('|')[:2] if not plugin_name in self.plugin_manager.plugins: - return the_input.auto_completion([''], n, quotify=True) + return the_input.new_completion([''], n, quotify=True) plugin = self.plugin_manager.plugins[plugin_name] end_list = [plugin.config.get(args[2], '', section or plugin_name), ''] else: -- cgit v1.2.3 From f097efd85221b30cd5293b3f7dc52ccbb6fdc05c Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 31 Oct 2014 15:54:33 +0100 Subject: Fix some tracebacks on /set completion (introduced by the automated default arguments of config.get) --- src/core/completions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/completions.py') diff --git a/src/core/completions.py b/src/core/completions.py index bc21a6c0..9549c13f 100644 --- a/src/core/completions.py +++ b/src/core/completions.py @@ -334,19 +334,19 @@ def completion_set(self, the_input): else: end_list = [] else: - end_list = [config.get(args[1], ''), ''] + end_list = [str(config.get(args[1], '')), ''] elif n == 3: if '|' in args[1]: plugin_name, section = args[1].split('|')[:2] if not plugin_name in self.plugin_manager.plugins: return the_input.new_completion([''], n, quotify=True) plugin = self.plugin_manager.plugins[plugin_name] - end_list = [plugin.config.get(args[2], '', section or plugin_name), ''] + end_list = [str(plugin.config.get(args[2], '', section or plugin_name)), ''] else: if not config.has_section(args[1]): end_list = [''] else: - end_list = [config.get(args[2], '', args[1]), ''] + end_list = [str(config.get(args[2], '', args[1])), ''] else: return return the_input.new_completion(end_list, n, quotify=True) -- cgit v1.2.3