コード例 #1
0
ファイル: completions.py プロジェクト: isabella232/poezio
 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)
コード例 #2
0
ファイル: completions.py プロジェクト: isabella232/poezio
 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, ' ')
コード例 #3
0
ファイル: ping.py プロジェクト: stressrelief/poezio
 def completion_ping(self, the_input):
     return Completion(the_input.auto_completion,
                       self.resources(),
                       '',
                       quotify=False)
コード例 #4
0
ファイル: completions.py プロジェクト: isabella232/poezio
 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)
コード例 #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)
コード例 #6
0
ファイル: ping.py プロジェクト: stressrelief/poezio
 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)
コード例 #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)
コード例 #8
0
ファイル: mpd_client.py プロジェクト: stressrelief/poezio
 def completion_mpd(self, the_input):
     return Completion(the_input.auto_completion, ['full'], quotify=False)
コード例 #9
0
 def toggle(self, the_input):
     "Completion for /toggle"
     return Completion(the_input.new_completion, config.options('Poezio'), 1, quotify=False)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)