+13
-8
@@ -52,14 +52,7 @@ def zip_common_root(zip_file: zipfile.ZipFile) -> str | None:
|
||||
return root
|
||||
|
||||
|
||||
def sources_dir_name() -> str:
|
||||
with open("./target/sources.tag") as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
def source_url(url: str):
|
||||
if os.path.exists("./target/sources.tag"):
|
||||
return
|
||||
def download_decompress(url: str) -> str:
|
||||
download_path = f"./target/{filename(url)}"
|
||||
download(url, download_path)
|
||||
|
||||
@@ -83,6 +76,18 @@ def source_url(url: str):
|
||||
with tarfile.open(download_path, "r") as tar:
|
||||
tar.extractall(extract_dir)
|
||||
|
||||
return sources_dir
|
||||
|
||||
|
||||
def sources_dir_name() -> str:
|
||||
with open("./target/sources.tag") as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
def source_url(url: str):
|
||||
if os.path.exists("./target/sources.tag"):
|
||||
return
|
||||
sources_dir = download_decompress(url)
|
||||
with open("./target/sources.tag", "wt+") as file:
|
||||
file.write(sources_dir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user