diff options
author | mathieui <mathieui@mathieui.net> | 2016-08-21 15:27:53 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2016-08-21 15:39:30 +0200 |
commit | 84e59b05ff0a17178da9ecdb6c5d084e48b42763 (patch) | |
tree | 224948d7c3d49a0005bff9390260357b3ec9c60e /plugins/irc.py | |
parent | 6c270b363ac018dfd4d66b23af95efcc35610da0 (diff) | |
download | poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.gz poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.bz2 poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.xz poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.zip |
Don’t call input completion() functions inside completion methods
Use a placeholder object that can run it afterwards, so that we don’t
have side effects inside those functions.
Diffstat (limited to 'plugins/irc.py')
-rw-r--r-- | plugins/irc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/irc.py b/plugins/irc.py index 56ce5c9c..263d7d22 100644 --- a/plugins/irc.py +++ b/plugins/irc.py @@ -131,6 +131,7 @@ Example configuration from poezio.plugin import BasePlugin from poezio.decorators import command_args_parser +from poezio.core.structs import Completion from poezio import common from poezio import tabs @@ -270,7 +271,7 @@ class Plugin(BasePlugin): sections.remove(section) except: pass - return the_input.new_completion(sections, pos) + return Completion(the_input.new_completion, sections, pos) @command_args_parser.quoted(1, 1) def command_irc_join(self, args): @@ -375,6 +376,6 @@ class Plugin(BasePlugin): sections = self.config.sections() if 'irc' in sections: sections.remove('irc') - return the_input.new_completion(sections, 1) + return Completion(the_input.new_completion, sections, 1) |