leaf_focus/pdf/info/item.py
def save_json(self, path: Path) -> None:
        """Write this info item to a file."""
        if not path:
            raise ValueError("Must provide path.")
        if path.suffix.lower() != ".json":
            raise ValueError("Must be a json file.")

        with open(path, "wt") as f:
            item_dict = dataclasses.asdict(self)
            json.dump(item_dict, f, indent=2, cls=LeafFocusJsonEncoder)
Write this info item to a file.
Write this info item to a file.
Write this info item to a file .
def save_json(self, path: Path) -> None:
        if not path:
            raise ValueError("Must provide path.")
        if path.suffix.lower() != ".json":
            raise ValueError("Must be a json file.")
        with open(path, "wt") as f:
            item_dict = dataclasses.asdict(self)
            json.dump(item_dict, f, indent=2, cls=LeafFocusJsonEncoder)
def save_json ( self , path : Path ) -> None : if not path : raise ValueError ( "Must provide path." ) if path . suffix . lower ( ) != ".json" : raise ValueError ( "Must be a json file." ) with open ( path , "wt" ) as f : item_dict = dataclasses . asdict ( self ) json . dump ( item_dict , f , indent = 2 , cls = LeafFocusJsonEncoder )
Write this info item to a file.
Write this info item to a file .
"""Write this info item to a file."""
self
path
Path