File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 33import json
44import sys
55import os
6+ import warnings
67from pathlib import Path
78from typing import Optional , Union , Callable , Any
89import time
@@ -585,6 +586,10 @@ def sign_file(
585586) -> str :
586587 """Sign a file with a C2PA manifest.
587588
589+ .. deprecated:: 0.10.12
590+ This function is deprecated and will be removed in a future version.
591+ Please use the Builder class for signing and the Reader class for reading signed data instead.
592+
588593 Args:
589594 source_path: Path to the source file
590595 dest_path: Path to write the signed file to
@@ -600,6 +605,13 @@ def sign_file(
600605 C2paError.Encoding: If any of the string inputs contain invalid UTF-8 characters
601606 C2paError.NotSupported: If the file type cannot be determined
602607 """
608+ warnings .warn (
609+ "The sign_file function is deprecated and will be removed in a future version. "
610+ "Please use the Builder class for signing and the Reader class for reading signed data instead." ,
611+ DeprecationWarning ,
612+ stacklevel = 2
613+ )
614+
603615 try :
604616 # Create a signer from the signer info
605617 signer = Signer .from_info (signer_info )
Original file line number Diff line number Diff line change @@ -775,9 +775,6 @@ def test_sign_file(self):
775775 temp_data_dir
776776 )
777777
778- print ("Signed manifest:" )
779- print (result_json )
780-
781778 finally :
782779 # Clean up
783780 if os .path .exists (output_path ):
You can’t perform that action at this time.
0 commit comments