big update: ui now show all info about user's profile. callbacks update. singleton added
This commit is contained in:
parent
4d4c0cb56a
commit
92635a7c89
6 changed files with 73 additions and 31 deletions
|
@ -1,13 +1,14 @@
|
|||
from platform import system
|
||||
import json
|
||||
import os
|
||||
from util import Singleton
|
||||
|
||||
|
||||
class Settings(dict):
|
||||
class Settings(dict, Singleton):
|
||||
|
||||
def __init__(self):
|
||||
self.path = Settings.get_default_path() + 'toxygen.json'
|
||||
if os.path.exists(self.path):
|
||||
if os.path.isfile(self.path):
|
||||
with open(self.path) as fl:
|
||||
data = fl.read()
|
||||
super(self.__class__, self).__init__(json.loads(data))
|
||||
|
@ -51,4 +52,3 @@ class Settings(dict):
|
|||
return os.getenv('HOME') + '/.config/tox/'
|
||||
elif system() == 'Windows':
|
||||
return os.getenv('APPDATA') + '/Tox/'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue