history update (time settings)
This commit is contained in:
parent
159e1f990a
commit
e173393853
7 changed files with 122 additions and 81 deletions
|
@ -8,6 +8,7 @@ class Settings(Singleton, dict):
|
|||
|
||||
def __init__(self, name=''):
|
||||
self.path = Settings.get_default_path() + str(name) + '.json'
|
||||
self.name = name
|
||||
if os.path.isfile(self.path):
|
||||
with open(self.path) as fl:
|
||||
data = fl.read()
|
||||
|
@ -64,6 +65,11 @@ class Settings(Singleton, dict):
|
|||
with open(self.path, 'w') as fl:
|
||||
fl.write(text)
|
||||
|
||||
def export(self, path):
|
||||
text = json.dumps(self)
|
||||
with open(path + str(self.name) + '.json', 'w') as fl:
|
||||
fl.write(text)
|
||||
|
||||
@staticmethod
|
||||
def get_default_path():
|
||||
if system() == 'Linux':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue