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()
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()
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
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)
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)