toxygen/src/settings.py
ingvar1995 a8d50bb699 Start
2016-02-16 21:11:56 +03:00

23 lines
513 B
Python

import getpass
import platform
import json
class Settings(object):
def __init__(self):
path = Settings.get_default_path() + 'toxygen.json'
with open(path) as fl:
data = fl.read()
self.data = json.loads(data)
def __get__(self, attr):
return self.data[attr]
@staticmethod
def get_default_path():
name = platform.system()
if name == 'Linux':
user = getpass.getuser()
return '/home/{}/.config/tox/'.format(user)