Skip to content

Commit 30378ab

Browse files
committed
version 0.6.1 Adjusted session saving mechanism.
1 parent e29db8c commit 30378ab

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pip install bicchiere
1515

1616
## [Project Demo App](https://bicchiere.eu.pythonanywhere.com)
1717

18-
Current version: 0.5.9
18+
Current version: 0.6.1
1919

2020
## A drop from Bicchiere
2121

bicchiere.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,17 @@ def run(self, *args, **kwargs):
576576
# Session handling support classes
577577

578578
class 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-
675679
class 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 = {}

oven/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
asgiref==3.5.2
2-
bicchiere==0.5.9
2+
bicchiere==0.6.1
33
bjoern==3.2.1
44
gevent==21.12.0
55
gevent-websocket==0.10.1

oven/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
#import activate
4+
35
from uuid import uuid4
46
import json
57
import os

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "bicchiere"
9-
version = "0.5.9"
9+
version = "0.6.1"
1010
description = "Yet another python web (WSGI) micro-framework"
1111
readme = "README.md"
1212
authors = [{ name = "Domingo E Savoretti", email = "esavoretti@gmail.com" }]

0 commit comments

Comments
 (0)