Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Feb 4, 2025
1 parent fd8f8cb commit 4574dfe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/schema-downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@
target = dspec['targetPattern'].replace('%s', version)
tempfile, _ = urlretrieve(source) # nosec B310
print(source, '->', target)
with open(tempfile, 'r') as tmpf, \
open(target, 'w', newline='\n') as tarf:
with open(tempfile, 'r') as tmpf:
text = tmpf.read()
with open(target, 'w', newline='\n') as tarf:
for search, replace in dspec['replace']:
text = text.replace(search, replace)
for search, replace in dspec['replaceRE']:
text = search.sub(replace, text)
tarf.write(text)

for source, target in OTHER_DOWNLOADABLES:
print(source, '->', target)
urlretrieve(source, target) # nosec B310

0 comments on commit 4574dfe

Please sign in to comment.