Skip to content

Commit 92c9db5

Browse files
author
Zhao Zuohong
committed
默认忽略tmp下所有内容;增加配置文件版本
1 parent 4bef61c commit 92c9db5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

main.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
from hash import hash
1313

1414
default_config = {
15+
"version": 1,
1516
"mirror": "https://mower.zhaozuohong.vip",
1617
"ignore": [
1718
"*.yml",
1819
"*.json",
19-
"tmp/*",
20+
"tmp/**/*",
2021
"log/*",
2122
"screenshot/**/*",
2223
"adb-buildin/*",
2324
],
2425
"install_dir": "",
25-
"pool_limit": 32,
26-
"dir_name": "mower",
26+
"pool_limit": 16,
2727
}
2828

2929
conf_dir_path = pathlib.Path(platformdirs.user_config_dir("mower_updater"))
@@ -32,7 +32,8 @@
3232
if conf_path.exists():
3333
with conf_path.open("r") as f:
3434
conf = json.load(f)
35-
default_config.update(conf)
35+
if "version" in conf and conf["version"] == default_config["version"]:
36+
default_config.update(conf)
3637
conf = default_config
3738

3839

@@ -105,7 +106,7 @@ def fetch_version_details(mirror, versions):
105106
try:
106107
r = s.get(url)
107108
pub_time = r.json()["time"]
108-
except Exception as e:
109+
except Exception:
109110
continue
110111
result.append(
111112
{

0 commit comments

Comments
 (0)