def do(self, *args, **kwargs): """ do the morphing. """ try: return self.func(*args, **kwargs) except Exception, ex: handle_exception()
def save(self): """ save fleet data and call save on all the bots. """ for i in self.bots: try: i.save() except Exception, ex: handle_exception()
def exit(self, name=None, jabber=False): """ call exit on all bots. if jabber=True only jabberbots will exit """ if not name: for i in self.bots: if jabber and not i.jabber: pass else: i.exit() return name = name.lower() for i in self.bots: if i.name == name: try: i.exit() except: handle_exception() self.remove(i) return 1