def generate_config(self): """ Generates config file from Class and instance attributes (only for sensible config parameters). """ config = {} # self.__dict__ doesn't give parent class attributes for key, value in inspect.getmembers(self): if is_json(value) and key[0] != "_": config[key] = value return config
def generate_config(self): """ Generates config file from Class parameters (only for sensible config parameters). """ config = {} for key, value in self.__dict__.items(): if is_json(value) and key[0] != "_": config[key] = value config["name"] = self.__class__.__name__ self.config = config