mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
added analyze function to wszst.szs
This commit is contained in:
parent
3ba2fa92e7
commit
352d77db6a
1 changed files with 18 additions and 0 deletions
|
@ -12,6 +12,24 @@ def extract(file: str, dest_dir: str = None) -> None:
|
||||||
creationflags=subprocess.CREATE_NO_WINDOW)
|
creationflags=subprocess.CREATE_NO_WINDOW)
|
||||||
|
|
||||||
|
|
||||||
|
def analyze(file: str) -> dict:
|
||||||
|
"""
|
||||||
|
return dictionnary with information about the track
|
||||||
|
:param file: track file
|
||||||
|
:return: directory
|
||||||
|
"""
|
||||||
|
ana_track = subprocess.run(["./tools/szs/wszst", "ANALYZE", file], check=True,
|
||||||
|
creationflags=subprocess.CREATE_NO_WINDOW, stdout=subprocess.PIPE).stdout.decode()
|
||||||
|
|
||||||
|
dict_track = {}
|
||||||
|
for line in ana_track.split("\n"):
|
||||||
|
if "=" in line:
|
||||||
|
key, value = line.split("=", maxsplit=1)
|
||||||
|
dict_track[key] = value.strip()
|
||||||
|
|
||||||
|
return dict_track
|
||||||
|
|
||||||
|
|
||||||
def sha1(file, autoadd_path: str = "./file/auto-add/") -> str:
|
def sha1(file, autoadd_path: str = "./file/auto-add/") -> str:
|
||||||
"""
|
"""
|
||||||
:param autoadd_path: directory where is autoadd directory
|
:param autoadd_path: directory where is autoadd directory
|
||||||
|
|
Loading…
Reference in a new issue