Beispiel #1
0
 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)
Beispiel #2
0
 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, ' ')
Beispiel #3
0
 def completion_ping(self, the_input):
     return Completion(the_input.auto_completion,
                       self.resources(),
                       '',
                       quotify=False)
Beispiel #4
0
 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)
Beispiel #5
0
 def completion_filename(the_input):
     txt = expanduser(the_input.get_text()[8:])
     files = glob(txt + '*')
     return Completion(the_input.auto_completion, files, quotify=False)
Beispiel #6
0
 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)
Beispiel #7
0
 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)
Beispiel #8
0
 def completion_mpd(self, the_input):
     return Completion(the_input.auto_completion, ['full'], quotify=False)
Beispiel #9
0
 def toggle(self, the_input):
     "Completion for /toggle"
     return Completion(the_input.new_completion, config.options('Poezio'), 1, quotify=False)
Beispiel #10
0
 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)
Beispiel #11
0
 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)
Beispiel #12
0
 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)
Beispiel #13
0
 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)