Download on demand

Delete only when files are corrupted
Download only when a new version of a file is available
close #39
This commit is contained in:
Howard20181 2022-08-26 02:33:27 +08:00
parent cd138840d8
commit f6a348a596
5 changed files with 98 additions and 67 deletions

View file

@ -32,8 +32,9 @@ arch = sys.argv[1]
if not os.path.exists(Path.cwd().parent / sys.argv[2] / "wsa"):
os.makedirs(Path.cwd().parent / sys.argv[2] / "wsa")
zip_name = ""
workdir = Path.cwd().parent / sys.argv[2] / "wsa"
with zipfile.ZipFile(Path.cwd().parent / "download/wsa.zip") as zip:
wsa_zip_path= Path(sys.argv[2]).resolve()
workdir = Path.cwd().parent / sys.argv[3] / "wsa"
with zipfile.ZipFile(wsa_zip_path) as zip:
for f in zip.filelist:
if arch in f.filename.lower():
zip_name = f.filename