def __init__(self, *args, **kwargs): "Parent must be initiated first" TypedObject.__init__(self, *args, **kwargs) # handlers _SA(self, "cmdset", LazyLoadHandler(self, "cmdset", CmdSetHandler, True)) _SA(self, "scripts", LazyLoadHandler(self, "scripts", ScriptHandler)) _SA(self, "nicks", LazyLoadHandler(self, "nicks", NickHandler))
def __init__(self): "Initiate to avoid AttributeErrors down the line" self.puppet = None self.player = None self.cmdset_storage_string = "" self.cmdset = LazyLoadHandler(self, "cmdset", cmdsethandler.CmdSetHandler, True)
def __init__(self, **kwargs): """the lockhandler works the same as for objects. optional kwargs will be set as properties on the Command at runtime, overloading evential same-named class properties.""" if kwargs: _init_command(self, **kwargs) self.lockhandler = LazyLoadHandler(self, "lockhandler", LockHandler)
def __init__(self, senders=None, receivers=None, channels=None, message="", header="", type="", lockstring="", hide_from=None): self.senders = senders and make_iter(senders) or [] self.receivers = receivers and make_iter(receivers) or [] self.channels = channels and make_iter(channels) or [] self.type = type self.header = header self.message = message self.lock_storage = lockstring self.locks = LazyLoadHandler(self, "locks", LockHandler) self.hide_from = hide_from and make_iter(hide_from) or [] self.date_sent = datetime.now()
def at_login(self, player): """ Hook called by sessionhandler when the session becomes authenticated. player - the player associated with the session """ self.player = player self.uid = self.player.id self.uname = self.player.username self.logged_in = True self.conn_time = time.time() self.puid = None self.puppet = None self.cmdset_storage = settings.CMDSET_SESSION # Update account's last login time. self.player.last_login = datetime.now() self.player.save() # add the session-level cmdset self.cmdset = LazyLoadHandler(self, "cmdset", cmdsethandler.CmdSetHandler, True)
def __init__(self, *args, **kwargs): TypedObject.__init__(self, *args, **kwargs) _SA(self, "tags", LazyLoadHandler(self, "tags", TagHandler)) _SA(self, "attributes", LazyLoadHandler(self, "attributes", AttributeHandler)) _SA(self, "aliases", LazyLoadHandler(self, "aliases", AliasHandler))
def __init__(self, *args, **kwargs): SharedMemoryModel.__init__(self, *args, **kwargs) self.locks = LazyLoadHandler(self, "locks", LockHandler) self.tags = LazyLoadHandler(self, "tags", TagHandler)
def __init__(self, *args, **kwargs): super(ScriptDB, self).__init__(*args, **kwargs) _SA(self, "attributes", LazyLoadHandler(self, "attributes", AttributeHandler)) _SA(self, "tags", LazyLoadHandler(self, "tags", TagHandler))