@@ -39,6 +39,7 @@ def custom_warning_formatter(message, category, filename, lineno, line=None):
39
39
40
40
41
41
warnings .formatwarning = custom_warning_formatter
42
+ logger = logging .getLogger (__name__ )
42
43
43
44
44
45
def json_load (filename ):
@@ -232,12 +233,12 @@ def pre_commit():
232
233
field .sep = "/"
233
234
if name in counts and bool (counts [name ]) ^ multilingual :
234
235
if not multilingual and field .schema ["type" ] == "object" :
235
- click .secho (f' { field .path } is an object. { " & " .join (counts [name ])} is/are multilingual.' , fg = "yellow" )
236
+ click .secho (f" { field .path } is an object. { ' & ' .join (counts [name ])} is/are multilingual." , fg = "yellow" )
236
237
elif multilingual :
237
238
raise click .ClickException (f"{ name } is multilingual at { field .path } , but not elsewhere" )
238
239
else :
239
240
raise click .ClickException (
240
- f' { name } is multilingual at { " & " .join (counts [name ])} , but not at { field .path } '
241
+ f" { name } is multilingual at { ' & ' .join (counts [name ])} , but not at { field .path } "
241
242
)
242
243
if multilingual :
243
244
counts [name ].append (field .path )
@@ -314,7 +315,7 @@ def update_currency():
314
315
# List One: Current Currency & Funds
315
316
current_codes = {}
316
317
url = "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/lists/list_one.xml"
317
- tree = etree .fromstring (get (url ).content ) # noqa: S320 # trusted external
318
+ tree = etree .fromstring (get (url ).content ) # trusted external
318
319
for node in tree .xpath ("//CcyNtry" ):
319
320
# Entries like Antarctica have no universal currency.
320
321
if node .xpath ("./Ccy" ):
@@ -329,7 +330,7 @@ def update_currency():
329
330
# List Three: Historic Denominations (Currencies & Funds)
330
331
historic_codes = {}
331
332
url = "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/lists/list_three.xml"
332
- tree = etree .fromstring (get (url ).content ) # noqa: S320 # trusted external
333
+ tree = etree .fromstring (get (url ).content ) # trusted external
333
334
for node in tree .xpath ("//HstrcCcyNtry" ):
334
335
code = node .xpath ("./Ccy" )[0 ].text
335
336
title = node .xpath ("./CcyNm" )[0 ].text .strip ()
@@ -406,7 +407,7 @@ def update_media_type():
406
407
template = row ["Template" ]
407
408
# All messages are expected to be about deprecation and obsoletion.
408
409
if message :
409
- logging .warning ("%s: %s" , message , code )
410
+ logger .warning ("%s: %s" , message , code )
410
411
# "x-emf" has "image/emf" in its "Template" value (but it is deprecated).
411
412
elif template and template != code :
412
413
raise click .ClickException (f"expected { code } , got { template } " )
0 commit comments