MCPcopy Index your code
hub / github.com/webpy/webpy / __getitem__

Method __getitem__

web/session.py:334–344  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

332 return bool(list(data))
333
334 def __getitem__(self, key):
335 now = datetime.datetime.now()
336 try:
337 s = self.db.select(self.table, where="session_id=$key", vars=locals())[0]
338 self.db.update(
339 self.table, where="session_id=$key", atime=now, vars=locals()
340 )
341 except IndexError:
342 raise KeyError(key)
343 else:
344 return self.decode(s.data)
345
346 def __setitem__(self, key, value):
347 # Remove the leading `b` of bytes object (`b"..."`), otherwise encoded

Callers

nothing calls this directly

Calls 3

selectMethod · 0.80
decodeMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected