@@ -581,7 +581,8 @@ def read_file(path: Union[str, Path],
581581 "The read_file function is deprecated and will be removed in a future version. "
582582 "Please use the Reader class for reading C2PA metadata instead." ,
583583 DeprecationWarning ,
584- stacklevel = 2 )
584+ stacklevel = 2
585+ )
585586
586587 container = _StringContainer ()
587588
@@ -625,7 +626,8 @@ def sign_file(
625626 "The sign_file function is deprecated and will be removed in a future version. "
626627 "Please use the Builder class for signing and the Reader class for reading signed data instead." ,
627628 DeprecationWarning ,
628- stacklevel = 2 )
629+ stacklevel = 2
630+ )
629631
630632 try :
631633 # Create a signer from the signer info
@@ -639,8 +641,7 @@ def sign_file(
639641 # Get the MIME type from the file extension
640642 mime_type = mimetypes .guess_type (str (source_path ))[0 ]
641643 if not mime_type :
642- raise C2paError .NotSupported (
643- f"Could not determine MIME type for file: { source_path } " )
644+ raise C2paError .NotSupported (f"Could not determine MIME type for file: { source_path } " )
644645
645646 # Sign the file using the builder
646647 manifest_bytes = builder .sign (
@@ -700,8 +701,7 @@ def __init__(self, file):
700701 Raises:
701702 TypeError: If the file object doesn't implement all required methods
702703 """
703- # Initialize _closed first to prevent AttributeError during garbage
704- # collection
704+ # Initialize _closed first to prevent AttributeError during garbage collection
705705 self ._closed = False
706706 self ._initialized = False
707707 self ._stream = None
@@ -1805,8 +1805,7 @@ def sign(
18051805 dest_stream = Stream (dest )
18061806
18071807 # Use the internal stream-base signing logic
1808- _ , manifest_bytes = self ._sign_internal (
1809- signer , format , source_stream , dest_stream )
1808+ _ , manifest_bytes = self ._sign_internal (signer , format , source_stream , dest_stream )
18101809 return manifest_bytes
18111810
18121811 def sign_file (self ,
@@ -1832,8 +1831,7 @@ def sign_file(self,
18321831 # Get the MIME type from the file extension
18331832 mime_type = mimetypes .guess_type (str (source_path ))[0 ]
18341833 if not mime_type :
1835- raise C2paError .NotSupported (
1836- f"Could not determine MIME type for file: { source_path } " )
1834+ raise C2paError .NotSupported (f"Could not determine MIME type for file: { source_path } " )
18371835
18381836 # Open source and destination files
18391837 with open (source_path , 'rb' ) as source_file , open (dest_path , 'wb' ) as dest_file :
@@ -1842,8 +1840,7 @@ def sign_file(self,
18421840 dest_stream = Stream (dest_file )
18431841
18441842 # Use the internal stream-base signing logic
1845- return self ._sign_internal (
1846- signer , mime_type , source_stream , dest_stream )
1843+ return self ._sign_internal (signer , mime_type , source_stream , dest_stream )
18471844
18481845
18491846def format_embeddable (format : str , manifest_bytes : bytes ) -> tuple [int , bytes ]:
0 commit comments