-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathankiaddon.py
More file actions
32 lines (26 loc) · 780 Bytes
/
ankiaddon.py
File metadata and controls
32 lines (26 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import zipfile
import os
from pathlib import Path
import shutil
root = Path(__file__).parents[1]
# create output folder
if not os.path.exists(f"{root}/releases"):
os.makedirs(f"{root}/releases")
# remove pycache
shutil.rmtree(f"{root}/forms/pyqt5UI/__pycache__", ignore_errors=True)
shutil.rmtree(f"{root}/forms/pyqt6UI/__pycache__", ignore_errors=True)
shutil.rmtree(f"{root}/src/__pycache__", ignore_errors=True)
shutil.rmtree(f"{root}/src/streakAchievement/__pycache__", ignore_errors=True)
# create .ankiaddon
data = [
"-c",
f"{root}/releases/AnkiLeaderboard.ankiaddon",
f"{root}/__init__.py",
f"{root}/config.json",
f"{root}/manifest.json",
f"{root}/License.txt",
f"{root}/designer",
f"{root}/forms",
f"{root}/src",
]
zipfile.main(data)