history update (time settings)

This commit is contained in:
ingvar1995 2016-03-13 15:06:06 +03:00
parent 159e1f990a
commit e173393853
7 changed files with 122 additions and 81 deletions

View file

@ -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':