mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Create session folder only if the session is actually created successfully (authorized)
This commit is contained in:
parent
3ad01d1ab0
commit
2ab61ebee6
@ -6,10 +6,12 @@ import output
|
|||||||
import time
|
import time
|
||||||
import sound
|
import sound
|
||||||
import logging
|
import logging
|
||||||
|
import config
|
||||||
import config_utils
|
import config_utils
|
||||||
import sqlitedict
|
import sqlitedict
|
||||||
import application
|
import application
|
||||||
from . import session_exceptions as Exceptions
|
from . import session_exceptions as Exceptions
|
||||||
|
|
||||||
log = logging.getLogger("sessionmanager.session")
|
log = logging.getLogger("sessionmanager.session")
|
||||||
|
|
||||||
class baseSession(object):
|
class baseSession(object):
|
||||||
@ -52,6 +54,13 @@ class baseSession(object):
|
|||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return self.logged
|
return self.logged
|
||||||
|
|
||||||
|
def create_session_folder(self):
|
||||||
|
path = os.path.join(paths.config_path(), self.session_id)
|
||||||
|
if not os.path.exists(path):
|
||||||
|
log.debug("Creating %s path" % (os.path.join(paths.config_path(), path),))
|
||||||
|
os.mkdir(path)
|
||||||
|
config.app["sessions"]["sessions"].append(id)
|
||||||
|
|
||||||
def get_configuration(self):
|
def get_configuration(self):
|
||||||
""" Get settings for a session."""
|
""" Get settings for a session."""
|
||||||
file_ = "%s/session.conf" % (self.session_id,)
|
file_ = "%s/session.conf" % (self.session_id,)
|
||||||
@ -63,7 +72,6 @@ class baseSession(object):
|
|||||||
def get_name(self):
|
def get_name(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def init_sound(self):
|
def init_sound(self):
|
||||||
try: self.sound = sound.soundSystem(self.settings["sound"])
|
try: self.sound = sound.soundSystem(self.settings["sound"])
|
||||||
except: pass
|
except: pass
|
||||||
|
Loading…
Reference in New Issue
Block a user