This commit is contained in:
yumoqing 2025-08-22 15:57:35 +08:00
parent e5d6fb4d15
commit a4602f2175
2 changed files with 0 additions and 24 deletions

View File

@ -448,20 +448,3 @@ else it will raise HTTPException exception
#### request['run_ns'] #### request['run_ns']
global environment now can access from request['run_ns'], it contains all the globals variable in ServerEnv and related variables of request global environment now can access from request['run_ns'], it contains all the globals variable in ServerEnv and related variables of request
### 1.0.9
#### MySession class
add MySession class for script to get or set data to session
usage
```
s = MySession(request)
messages = s.messages
if not messages:
messages = []
messages.append("ergegrtgh")
s.messages = messages
```

View File

@ -82,12 +82,6 @@ def server_error(errcode):
E = exceptions.get(errcode, HTTPException) E = exceptions.get(errcode, HTTPException)
raise E() raise E()
class MySession(DictObject):
def __init__(self, request, **kw):
super().__init__(**kw)
self.request = request
self.update(get_session(request))
def basic_auth_headers(user, passwd): def basic_auth_headers(user, passwd):
ba = BasicAuth(login=user, password=passwd) ba = BasicAuth(login=user, password=passwd)
return { return {
@ -318,7 +312,6 @@ def initEnv():
g.partial = partial g.partial = partial
g.StreamHttpClient = StreamHttpClient g.StreamHttpClient = StreamHttpClient
g.server_error = server_error g.server_error = server_error
g.MySession = MySession
def set_builtins(): def set_builtins():
all_builtins = [ i for i in dir(builtins) if not i.startswith('_')] all_builtins = [ i for i in dir(builtins) if not i.startswith('_')]