Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit d99f435

Browse files
committed
style: format python script
1 parent 96c810e commit d99f435

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

makedeps.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Dependency versions
1010
maafw_version = "v1.7.0-alpha.2"
1111

12+
1213
def copy_file_recursively(src, dst, system):
1314
if os.path.isdir(src):
1415
if not os.path.exists(dst):
@@ -23,6 +24,7 @@ def copy_file_recursively(src, dst, system):
2324
else:
2425
os.system("cp " + src + " " + dst)
2526

27+
2628
def download(url: str, fname: str, chunk_size=1024):
2729
resp = requests.get(url, stream=True)
2830
total = int(resp.headers.get('content-length', 0))
@@ -37,10 +39,11 @@ def download(url: str, fname: str, chunk_size=1024):
3739
size = file.write(data)
3840
bar.update(size)
3941

42+
4043
def figure_triplet():
4144
supported_triplets = {
42-
"windows": ["x86_64","aarch64"],
43-
"linux": ["x86_64","aarch64"],
45+
"windows": ["x86_64", "aarch64"],
46+
"linux": ["x86_64", "aarch64"],
4447
# may add macos support in the future
4548
}
4649

@@ -60,13 +63,15 @@ def figure_triplet():
6063

6164
return host_system, host_arch
6265

66+
6367
def setup_deps_dir():
6468
deps_dir = "deps"
6569
if not os.path.exists(deps_dir):
6670
os.makedirs(deps_dir)
6771

6872
return deps_dir
6973

74+
7075
def setup_maafw_dynamic_libs(host_system, fw_dir):
7176
needed_libs = [
7277
"fastdeploy_ppocr_maa",
@@ -80,6 +85,7 @@ def setup_maafw_dynamic_libs(host_system, fw_dir):
8085
lib_dir = os.path.join(fw_dir, "bin")
8186
copy_file_recursively(lib_dir, os.path.join("tauri"), host_system)
8287

88+
8389
def setup_maafw(host_system, host_arch, dst, force=False):
8490
print("Setting up MAA Framework")
8591
print("Downloading MAA Framework " + maafw_version)
@@ -88,8 +94,10 @@ def setup_maafw(host_system, host_arch, dst, force=False):
8894
print("MAA Framework already downloaded")
8995
else:
9096
maafw_base_url = "https://github.com/MaaAssistantArknights/MaaFramework/releases/download/"
91-
triplet_string = ("win" if host_system == "windows" else host_system) + "-" + host_arch
92-
maafw_url = maafw_base_url + maafw_version + "/MAA-" + triplet_string + "-" + maafw_version + ".zip"
97+
triplet_string = ("win" if host_system ==
98+
"windows" else host_system) + "-" + host_arch
99+
maafw_url = maafw_base_url + maafw_version + "/MAA-" + \
100+
triplet_string + "-" + maafw_version + ".zip"
93101
print("Downloading from " + maafw_url)
94102
download(maafw_url, maafw_zip)
95103

@@ -111,7 +119,8 @@ def main():
111119
host_system, host_arch = figure_triplet()
112120
print("Setting up dependencies for " + host_system + "-" + host_arch)
113121
triplet_dir = setup_deps_dir()
114-
setup_maafw(host_system, host_arch, triplet_dir,force)
122+
setup_maafw(host_system, host_arch, triplet_dir, force)
123+
115124

116125
if __name__ == "__main__":
117-
main()
126+
main()

0 commit comments

Comments
 (0)