Skip to content

Commit 7b88bb1

Browse files
committed
fix: Format
1 parent 1e9b92e commit 7b88bb1

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/c2pa/c2pa.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,15 @@ def __init__(self, alg, sign_cert, private_key, ta_url):
235235
"""Initialize C2paSignerInfo with optional parameters.
236236
237237
Args:
238-
alg: The signing algorithm, either as a C2paSigningAlg enum or string or bytes
238+
alg: The signing algorithm, either as a
239+
C2paSigningAlg enum or string or bytes
239240
(will be converted accordingly to bytes for native library use)
240241
sign_cert: The signing certificate as a string
241242
private_key: The private key as a string
242243
ta_url: The timestamp authority URL as bytes
243244
"""
244-
# Handle alg parameter: can be C2paSigningAlg enum or string (or bytes), convert as needed
245+
# Handle alg parameter: can be C2paSigningAlg enum
246+
# or string (or bytes), convert as needed
245247
if isinstance(alg, C2paSigningAlg):
246248
# Convert enum to string representation
247249
alg_str = _ALG_TO_STRING_BYTES_MAPPING.get(alg)
@@ -255,17 +257,23 @@ def __init__(self, alg, sign_cert, private_key, ta_url):
255257
# In bytes already
256258
pass
257259
else:
258-
raise TypeError(f"alg must be C2paSigningAlg enum, string, or bytes, got {type(alg)}")
260+
raise TypeError(
261+
f"alg must be C2paSigningAlg enum, string, or bytes, "
262+
f"got {type(alg)}"
263+
)
259264

260-
# Handle ta_url parameter: allow string or bytes, convert string to bytes as needed
265+
# Handle ta_url parameter:
266+
# allow string or bytes, convert string to bytes as needed
261267
if isinstance(ta_url, str):
262268
# String to bytes, as requested by native lib
263269
ta_url = ta_url.encode('utf-8')
264270
elif isinstance(ta_url, bytes):
265271
# In bytes already
266272
pass
267273
else:
268-
raise TypeError(f"ta_url must be string or bytes, got {type(ta_url)}")
274+
raise TypeError(
275+
f"ta_url must be string or bytes, got {type(ta_url)}"
276+
)
269277

270278
# Call parent constructor with processed values
271279
super().__init__(alg, sign_cert, private_key, ta_url)

0 commit comments

Comments
 (0)