lnbits-legend/lnbits/requestvars.py

11 lines
198 B
Python
Raw Normal View History

import contextvars
import types
2021-10-17 19:33:29 +02:00
request_global = contextvars.ContextVar(
"request_global", default=types.SimpleNamespace()
)
def g() -> types.SimpleNamespace:
return request_global.get()