Allow to specify alternative configuration specs for sessions

This commit is contained in:
Manuel Cortez 2021-08-27 13:45:59 -05:00
parent 3a5c1c10d3
commit 7c34204d17

View File

@ -43,6 +43,8 @@ class baseSession(object):
self.logged = False self.logged = False
self.settings = None self.settings = None
self.db={} self.db={}
# Config specification file.
self.config_spec = "conf.defaults"
@property @property
def is_logged(self): def is_logged(self):
@ -52,7 +54,7 @@ class baseSession(object):
""" Get settings for a session.""" """ Get settings for a session."""
file_ = "%s/session.conf" % (self.session_id,) file_ = "%s/session.conf" % (self.session_id,)
log.debug("Creating config file %s" % (file_,)) log.debug("Creating config file %s" % (file_,))
self.settings = config_utils.load_config(os.path.join(paths.config_path(), file_), os.path.join(paths.app_path(), "Conf.defaults")) self.settings = config_utils.load_config(os.path.join(paths.config_path(), file_), os.path.join(paths.app_path(), self.config_spec))
self.init_sound() self.init_sound()
self.load_persistent_data() self.load_persistent_data()