def __getattr__(self, name): if not name.startswith("generate_"): raise AttributeError(name) field = name[len("generate_"):] result = getattr(self, field)() total_json_file = os.path.join(Configs().find(self.project_id).result_dir(), field + '.txt'); os.write_to_file(total_json_file, result) return lambda : {}