def load(self): """ Add all forms from the form path. """ # load classes for cls in classes_in_path(settings.PATH_REQUEST_PROCESSERS_BASE, BaseRequestProcesser): path = cls.path name = cls.name if not path and not name: logger.log_errmsg("Missing request's path and name.") continue if path[0] != "/": path = "/" + path if name is None: name = "" if self.dict.has_key(( path, name, )): logger.log_infomsg("Request %s-%s is replaced by %s." % (path, name, cls)) self.dict[( path, name, )] = cls()
def load(self): """ Add all event actions from the path. """ # load classes for cls in classes_in_path(settings.PATH_EVENT_ACTION_BASE, BaseEventAction): key = cls.key if key: if key in self.dict: logger.log_infomsg("Event action %s is replaced by %s." % (key, cls)) self.dict[key] = cls()
def load(self): """ Add all event actions from the path. """ # load classes for cls in classes_in_path(settings.PATH_EVENT_ACTION_BASE, BaseEventAction): key = cls.key if self.dict.has_key(key): logger.log_infomsg("Event action %s is replaced by %s." % (key, cls)) self.dict[key] = cls()
def load(self): """ Add all quest status from the path. """ # load classes for cls in classes_in_path(settings.PATH_QUEST_STATUS_BASE, BaseQuestStatus): key = cls.key if key in self.dict: logger.log_infomsg("Quest status %s is replaced by %s." % (key, cls)) self.dict[key] = cls()
def load(self): """ Add all forms from the form path. """ # load classes for cls in classes_in_path(settings.PATH_DATA_FORMS_BASE, forms.ModelForm): if hasattr(cls, "Meta") and hasattr(cls.Meta, "model"): model = cls.Meta.model model_name = model.__name__ if self.dict.has_key(model_name): logger.log_infomsg("Form %s is replaced by %s." % (model_name, cls)) self.dict[model_name] = cls
def load(self): """ Add all forms from the form path. """ # load classes for cls in classes_in_path(settings.PATH_DATA_FORMS_BASE, forms.ModelForm): if hasattr(cls, "Meta") and hasattr(cls.Meta, "model"): model = cls.Meta.model model_name = model.__name__ if self.dict.has_key(model_name): logger.log_infomsg("Form %s is replaced by %s." % (model_name, cls)) self.dict[model_name] = cls