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
1 changed files with 12 additions and 3 deletions

View File

@ -48,9 +48,8 @@ class StorageType:
def get_storage(self): def get_storage(self):
if self.storage_type is None: if self.storage_type is None:
storage = self.default_storage self.storage_type = self.default_storage
else: storage = self.storage_type
storage = self.storage_type
return 'tiramisu.storage.{0}.storage'.format( return 'tiramisu.storage.{0}.storage'.format(
storage) storage)
@ -226,6 +225,16 @@ def get_storage(context, session_id, is_persistent):
['Storage'], -1).Storage(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): class Settings(object):
"``Config()``'s configuration options" "``Config()``'s configuration options"