def get(self, load_session: annotate.partial(load_session), name=None): if self.session is None: self.record = load_session() if self.record is None: self.session = {} else: self.session = json.loads(self.record.data) self.session_orig = copy.copy(self.session) if name is not None: if name not in self.session: raise UnsetError() return self.session[name] return self.session
def session_end_factory(end: annotate.partial(session_end)): return end
def session_start_factory(start: annotate.partial(session_start)): return start