diff --git a/tiramisu/setting.py b/tiramisu/setting.py index c9d4a0b..952d52a 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -48,9 +48,8 @@ class StorageType: def get_storage(self): if self.storage_type is None: - storage = self.default_storage - else: - storage = self.storage_type + self.storage_type = self.default_storage + storage = self.storage_type return 'tiramisu.storage.{0}.storage'.format( storage) @@ -226,6 +225,16 @@ def get_storage(context, session_id, is_persistent): ['Storage'], -1).Storage(session_id, is_persistent) +def list_sessions(): + return __import__(storage_type.get_storage(), globals(), locals(), + ['list_sessions'], -1).list_sessions() + + +def delete_session(session_id): + return __import__(storage_type.get_storage(), globals(), locals(), + ['delete_session'], -1).delete_session(session_id) + + #____________________________________________________________ class Settings(object): "``Config()``'s configuration options"