leaf_focus/pdf/identify/component.py
def create(self, pdf_path: Path, file_hash: str, identify_path: Path):
        """Create a file that identifies a pdf."""

        if not pdf_path:
            raise ValueError("Must supply pdf file.")
        if not identify_path:
            raise ValueError("Must supply identify file.")
        if not pdf_path.exists():
            raise FileNotFoundError(f"Pdf file does not exist '{pdf_path}'.")

        # get the hash of the source file
        hash_type = self.file_hash_type

        # write the identify file as json
        item = Item(pdf_file=pdf_path, hash_type=hash_type, file_hash=file_hash)
        item.write(identify_path)
Create a file that identifies a pdf.
Create a file that identifies a pdf.
Create a file that identifies a pdf .
def create(self, pdf_path: Path, file_hash: str, identify_path: Path):
        if not pdf_path:
            raise ValueError("Must supply pdf file.")
        if not identify_path:
            raise ValueError("Must supply identify file.")
        if not pdf_path.exists():
            raise FileNotFoundError(f"Pdf file does not exist '{pdf_path}'.")
        hash_type = self.file_hash_type
        item = Item(pdf_file=pdf_path, hash_type=hash_type, file_hash=file_hash)
        item.write(identify_path)
def create ( self , pdf_path : Path , file_hash : str , identify_path : Path ) : if not pdf_path : raise ValueError ( "Must supply pdf file." ) if not identify_path : raise ValueError ( "Must supply identify file." ) if not pdf_path . exists ( ) : raise FileNotFoundError ( f"Pdf file does not exist '{pdf_path}'." ) hash_type = self . file_hash_type item = Item ( pdf_file = pdf_path , hash_type = hash_type , file_hash = file_hash ) item . write ( identify_path )
Create a file that identifies a pdf.
Create a file that identifies a pdf .
"""Create a file that identifies a pdf.""" # get the hash of the source file # write the identify file as json
self
pdf_path
Path
file_hash
str
identify_path
Path