Skip to content

Commit 5196f9a

Browse files
committed
Fix: wrong config path
1 parent 9b3ffb0 commit 5196f9a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

qrshare/config/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get(self, key) -> Optional[Any]:
2424

2525
def save(self):
2626
with self.path.open('w') as f:
27-
json.dump(self.data, f)
27+
json.dump(self.data, f, indent=4, sort_keys=True)
2828

2929
def load(self):
3030
try:

qrshare/config/user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from appdirs import user_config_dir
55
from .base import ConfigBase
66

7-
appname = 'Novelsave'
7+
appname = 'qrshare'
88
appauthor = 'mHaisham'
99

1010
class UserConfig:
@@ -13,10 +13,10 @@ def __init__(self):
1313
self.path = Path(user_config_dir(appname, appauthor))
1414
self.path.mkdir(parents=True, exist_ok=True)
1515

16-
self.config = ConfigBase(self.path, 'config.json')
16+
self.config = ConfigBase(self.path, 'config.json', load=True)
1717
self.init_secret_key()
1818

1919
def init_secret_key(self):
2020
key = self.config.get("SECRET_KEY")
2121
if key is None:
22-
self.config.put("SECRET_KEY", uuid4().get_hex())
22+
self.config.put("SECRET_KEY", str(uuid4()))

0 commit comments

Comments
 (0)