Skip to content

Commit 77a1161

Browse files
committed
feat(updater): more config
Signed-off-by: Me0wo <[email protected]>
1 parent e7870da commit 77a1161

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

Updater/config/model.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from pydantic import BaseModel
2+
3+
4+
class PathConfig(BaseModel):
5+
workPath: str = "../"
6+
processName: str = "QuickNote"
7+
tagPath: str = "./tags"
8+
9+
class ProxyConfig(BaseModel):
10+
url: str = ""
11+
12+
class Config(BaseModel):
13+
path: PathConfig = PathConfig()
14+
proxy: ProxyConfig = ProxyConfig()

Updater/config/yml_loader.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
from pathlib import Path
33

44
import yaml
5-
from pydantic import BaseModel
65

6+
from Updater.config.model import Config
77

8-
class PathConfig(BaseModel):
9-
processPath: str = "../QuickNote"
10-
tagPath: str = "./tags"
11-
12-
class ProxyConfig(BaseModel):
13-
url: str = ""
14-
15-
class Config(BaseModel):
16-
path: PathConfig = PathConfig()
17-
proxy: ProxyConfig = ProxyConfig()
188

199
@lru_cache()
2010
def get_config() -> Config:

Updater/data/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
path:
2-
processPath: ../QuickNote.exe
2+
workPath: ../
3+
processName: QuickNote.exe
34
tagPath: ./data/tags
45

56
proxy:

0 commit comments

Comments
 (0)