예제 #1
0
    def from_json(path: Path) -> "Meta":
        text = path.read_text()
        json_data = json.loads(text)
        authors = list(
            map(lambda author_content: Author.from_dict(author_content),
                json_data["authors"]))

        return Meta(path, int(json_data["dataset_id"]),
                    int(json_data["branch_id"]), json_data["description"],
                    authors)
 def _read(self):
     content = ConfigManager.dict_from_json(self._path.read_text())
     self._default_author = Author.from_dict(content["default_author"])