MCPcopy
hub / github.com/hugapi/hug / get

Method get

hug/store.py:36–42  ·  view source on GitHub ↗

Get data for given store key. Raise hug.exceptions.StoreKeyNotFound if key does not exist.

(self, key)

Source from the content-addressed store, hash-verified

34 self._data = {}
35
36 def get(self, key):
37 """Get data for given store key. Raise hug.exceptions.StoreKeyNotFound if key does not exist."""
38 try:
39 data = self._data[key]
40 except KeyError:
41 raise StoreKeyNotFound(key)
42 return data
43
44 def exists(self, key):
45 """Return whether key exists or not."""

Callers 1

test_session_middlewareFunction · 0.95

Calls 1

StoreKeyNotFoundClass · 0.90

Tested by 1

test_session_middlewareFunction · 0.76