@@ -576,15 +576,17 @@ def run(self, *args, **kwargs):
576576# Session handling support classes
577577
578578class SuperDict (dict ):
579+ "Dictionary that makes no difference between items and attributes"
580+
579581 def __getattr__ (self , attr ):
580582 return super ().get (attr )
581583
582584 def __setattr__ (self , attr , val ):
583- super () .__setitem__ (attr , val )
585+ self .__setitem__ (attr , val )
584586
585587 def __delattr__ (self , attr ):
586- if super () .get (attr ):
587- super () .__delitem__ (attr )
588+ if self .get (attr ):
589+ self .__delitem__ (attr )
588590
589591 def __getitem__ (self , key ):
590592 return super ().get (key )
@@ -662,16 +664,18 @@ def get_file(self):
662664
663665 def __setitem__ (self , __k : str , __v ) -> str :
664666 super ().__setitem__ (__k , __v )
665- # if __k == "sid":
666- # return json.dumps(self)
667- return self .save ()
667+ if __k == "sid" :
668+ return __v
669+ else :
670+ return self .save ()
668671
669672 def __delitem__ (self , __k : str ) -> str :
673+ if __k == "sid" :
674+ return
670675 super ().__delitem__ (__k )
671676 return self .save ()
672677
673678
674-
675679class FileSession (Session ):
676680 """File system based session handler class"""
677681
@@ -809,7 +813,7 @@ class Bicchiere(BicchiereMiddleware):
809813 Main WSGI application class
810814 """
811815
812- __version__ = (0 , 5 , 9 )
816+ __version__ = (0 , 6 , 1 )
813817 __author__ = "Domingo E. Savoretti"
814818 config = default_config
815819 template_filters = {}
0 commit comments