From 815cd46be9c47899f520ee8329c5cfb33082c74d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 12 Jun 2016 13:25:45 +0100 Subject: Fix core completion, broken in the previous commit. --- poezio/core/core.py | 73 ++++++++++++++++++----------------------------------- 1 file changed, 25 insertions(+), 48 deletions(-) (limited to 'poezio/core/core.py') diff --git a/poezio/core/core.py b/poezio/core/core.py index 4a442032..e4cc2340 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -42,7 +42,7 @@ from text_buffer import TextBuffer from theming import get_theme import keyboard -from . import completions +from . completions import CompletionCore from . import commands from . import handlers from . structs import POSSIBLE_SHOW, DEPRECATED_ERRORS, \ @@ -55,6 +55,7 @@ class Core(object): """ def __init__(self): + self.completion = CompletionCore(self) # All uncaught exception are given to this callback, instead # of being displayed on the screen and exiting the program. sys.excepthook = self.on_exception @@ -1729,7 +1730,7 @@ class Core(object): self.register_command('help', self.command_help, usage='[command]', shortdesc='\\_o< KOIN KOIN KOIN', - completion=self.completion_help) + completion=self.completion.help) self.register_command('join', self.command_join, usage="[room_name][@server][/nick] [password]", desc="Join the specified room. You can specify a nickname " @@ -1744,7 +1745,7 @@ class Core(object): "/join room2\n/join /me_again\n/join\n/join room@server" ".tld/my_nick password\n/join / password", shortdesc='Join a room', - completion=self.completion_join) + completion=self.completion.join) self.register_command('exit', self.command_quit, desc='Just disconnect from the server and exit poezio.', shortdesc='Exit poezio.') @@ -1758,7 +1759,7 @@ class Core(object): self.register_command('win', self.command_win, usage='', shortdesc='Go to the specified room', - completion=self.completion_win) + completion=self.completion.win) self.commands['w'] = self.commands['win'] self.register_command('move_tab', self.command_move_tab, usage=' ', @@ -1769,7 +1770,7 @@ class Core(object): "address. You can use \".\" as a shortcut for the current " "tab.", shortdesc='Move a tab.', - completion=self.completion_move_tab) + completion=self.completion.move_tab) self.register_command('destroy_room', self.command_destroy_room, usage='[room JID]', desc='Try to destroy the room [room JID], or the current' @@ -1784,7 +1785,7 @@ class Core(object): ", chat, away, afk, dnd, busy, xa\" and the optional " "[status message] argument will be your status message.", shortdesc='Change your availability.', - completion=self.completion_status) + completion=self.completion.status) self.commands['status'] = self.commands['show'] self.register_command('bookmark_local', self.command_bookmark_local, usage="[roomname][/nick] [password]", @@ -1796,7 +1797,7 @@ class Core(object): "with the nickname you\'re currently using in this room " "(instead of default_nick)", shortdesc='Bookmark a room locally.', - completion=self.completion_bookmark_local) + completion=self.completion.bookmark_local) self.register_command('bookmark', self.command_bookmark, usage="[roomname][/nick] [autojoin] [password]", desc="Bookmark: Bookmark online the specified room (you " @@ -1807,7 +1808,7 @@ class Core(object): " room will be bookmarked with the nickname you\'re " "currently using in this room (instead of default_nick).", shortdesc="Bookmark a room online.", - completion=self.completion_bookmark) + completion=self.completion.bookmark) self.register_command('set', self.command_set, usage="[plugin|][section]