1
0
Fork 0
forked from Fuji/Fuji

Switched from json config to ini configuration file; fixed a issue with language being set to polish only

This commit is contained in:
Maarceeli 2025-02-22 16:00:15 +01:00
parent b17be83791
commit 6681ab4cf3
7 changed files with 71 additions and 27 deletions

View file

@ -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"