save storage with get_storage

list_sessions and delete_session is now in setting directly
This commit is contained in:
Emmanuel Garette 2013-08-26 21:54:41 +02:00
parent 0bc47b1cf9
commit fb1eba39ea

View file

@ -48,8 +48,7 @@ class StorageType:
def get_storage(self):
if self.storage_type is None:
storage = self.default_storage
else:
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"