Switched from json config to ini configuration file; fixed a issue with language being set to polish only
This commit is contained in:
parent
b17be83791
commit
6681ab4cf3
7 changed files with 71 additions and 27 deletions
14
src/utils.py
14
src/utils.py
|
@ -1,4 +1,6 @@
|
|||
import keyring
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
def saveauth(service, username, data, chunk_size=1000):
|
||||
chunks = [data[i:i+chunk_size] for i in range(0, len(data), chunk_size)]
|
||||
|
@ -13,3 +15,15 @@ def loadauth(service, username):
|
|||
return "".join(keyring.get_password(service, f"{username}_{i}") or "" for i in range(count))
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
|
||||
def getconfigpath():
|
||||
platform = os.name
|
||||
home = Path.home()
|
||||
|
||||
match platform:
|
||||
case 'posix':
|
||||
return f"{home}/.config/Fuji"
|
||||
case 'Darwin':
|
||||
return f"{home}/.FujiConfig"
|
||||
case 'nt':
|
||||
return f"{home}/AppData/Local/Fuji"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue