Пример #1
0
 def cmd_info(self, args):
     self.buffer.deactivate_command_table()
     try:
         if not args.get():
             args = ui.CommandArgs(self.peer.as_unicode())
         ui.run_command("info", args)
     finally:
         self.buffer.activate_command_table()
Пример #2
0
 def cmd_info(self,args):
     self.buffer.deactivate_command_table()
     try:
         if not args.get():
             args=ui.CommandArgs(self.peer.as_unicode())
         ui.run_command("info",args)
     finally:
         self.buffer.activate_command_table()
Пример #3
0
 def handle_event(self,event,arg):
     handlers=self.settings.get("event_handlers",[])
     for h in handlers:
         s=h.split(":",1)
         if len(s)!=2:
             continue
         ev,command=s
         try:
             if re.match(ev,event):
                 if command:
                     ui.run_command(command)
                 return
         except re.error:
             continue
Пример #4
0
 def cmd_query(self, args):
     nick = args.shift()
     if not nick:
         raise CommandError,"No nickname given"
     if nick not in self.room_state.users:
         self.buffer.append_themed("error", "No '%s' in this room", nick)
         self.buffer.update()
         return 1
     user = self.room_state.users[nick]
     rest = args.all()
     args = u'"%s"' % (user.room_jid.as_unicode().replace('"', '\\"'), )
     if rest:
         args = ui.CommandArgs(args + u" " + rest)
     else:
         args = ui.CommandArgs(args)
     ui.run_command("chat", args)
Пример #5
0
 def cmd_query(self, args):
     nick = args.shift()
     if not nick:
         raise CommandError, "No nickname given"
     if nick not in self.room_state.users:
         self.buffer.append_themed("error", "No '%s' in this room", nick)
         self.buffer.update()
         return 1
     user = self.room_state.users[nick]
     rest = args.all()
     args = u'"%s"' % (user.room_jid.as_unicode().replace('"', '\\"'), )
     if rest:
         args = ui.CommandArgs(args + u" " + rest)
     else:
         args = ui.CommandArgs(args)
     ui.run_command("chat", args)