def help(self, the_input): """Completion for /help.""" commands = sorted(self.core.commands.keys()) + sorted( self.core.tabs.current_tab.commands.keys()) return Completion(the_input.new_completion, commands, 1, quotify=False)
def server_cycle(self, the_input): """Completion for /server_cycle""" serv_list = set() for tab in self.core.get_tabs(tabs.MucTab): serv_list.add(tab.jid.server) return Completion(the_input.new_completion, sorted(serv_list), 1, ' ')
def completion_ping(self, the_input): return Completion(the_input.auto_completion, self.resources(), '', quotify=False)
def remove_bookmark(self, the_input): """Completion for /remove_bookmark""" return Completion(the_input.new_completion, [bm.jid for bm in self.core.bookmarks], 1, quotify=False)
def completion_filename(the_input): txt = expanduser(the_input.get_text()[8:]) files = glob(txt + '*') return Completion(the_input.auto_completion, files, quotify=False)
def completion_muc_ping(self, the_input): users = [user.nick for user in self.api.current_tab().users] l = self.resources() users.extend(l) return Completion(the_input.auto_completion, users, '', quotify=False)
def completion_remove(self, the_input): """ Completion for /remove """ jids = [jid for jid in roster.jids()] return Completion(the_input.auto_completion, jids, '', quotify=False)
def completion_mpd(self, the_input): return Completion(the_input.auto_completion, ['full'], quotify=False)
def toggle(self, the_input): "Completion for /toggle" return Completion(the_input.new_completion, config.options('Poezio'), 1, quotify=False)
def status(self, the_input): """ Completion of /status """ if the_input.get_argument_position() == 1: return Completion(the_input.new_completion, [status for status in POSSIBLE_SHOW], 1, ' ', quotify=False)
def mood(self, the_input): """Completion for /mood""" n = the_input.get_argument_position(quoted=True) if n == 1: return Completion(the_input.new_completion, sorted(pep.MOODS.keys()), 1, quotify=True)
def decline(self, the_input): """Completion for /decline""" n = the_input.get_argument_position(quoted=True) if n == 1: return Completion(the_input.auto_completion, sorted(self.core.pending_invites.keys()), 1, '', quotify=True)
def version(self, the_input): """Completion for /version""" comp = reduce(lambda x, y: x + [i.jid for i in y], (roster[jid].resources for jid in roster.jids() if len(roster[jid])), []) return Completion(the_input.new_completion, sorted(comp), 1, quotify=False)