Example tests for services! General cleanup.

(cherry picked from commit 9f41bb4)
This commit is contained in:
Ebag333
2017-03-23 15:52:26 -07:00
parent 13305d9ee1
commit 5d5c95fb2c
4 changed files with 17 additions and 1071 deletions

View File

@@ -42,13 +42,15 @@ class SettingsProvider(object):
return cls._instance
def __init__(self):
if not os.path.exists(self.BASE_PATH):
os.mkdir(self.BASE_PATH)
if hasattr(self, 'BASE_PATH'):
if not os.path.exists(self.BASE_PATH):
os.mkdir(self.BASE_PATH)
def getSettings(self, area, defaults=None):
s = self.settings.get(area)
if s is None:
if s is None and hasattr(self, 'BASE_PATH'):
p = os.path.join(self.BASE_PATH, area)
if not os.path.exists(p):
@@ -72,6 +74,8 @@ class SettingsProvider(object):
info[item] = defaults[item]
self.settings[area] = s = Settings(p, info)
else:
s = None
return s