Skip to content

Commit

Permalink
update fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
danny0838 committed May 4, 2024
1 parent 7fb494a commit 52020f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ def main():

with zipfile.ZipFile(file) as zh:
for zipinfo in zh.infolist():
print(f'checking: {zipinfo.filename}')

# remove top dir from path
zipinfo.filename = '/'.join(zipinfo.filename.split('/')[1:])

for src, dst in OPENCC_DIR_MAP.items():
if os.path.dirname(zipinfo.filename) == src:
zipinfo.filename = f'{dst}/{os.path.basename(zipinfo.filename)}'
print(f'extracting to: {zipinfo.filename}')
zh.extract(zipinfo, dicts_dir)

# MediaWiki
Expand Down

0 comments on commit 52020f8

Please sign in to comment.