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

Method __setitem__

web/session.py:283–295  ·  view source on GitHub ↗
(self, key, value)

Source from the content-addressed store, hash-verified

281 raise KeyError(key)
282
283 def __setitem__(self, key, value):
284 path = self._get_path(key)
285 pickled = self.encode(value)
286 try:
287 tname = path + "." + threading.current_thread().name
288 f = open(tname, "wb")
289 try:
290 f.write(pickled)
291 finally:
292 f.close()
293 shutil.move(tname, path) # atomary operation
294 except OSError:
295 pass
296
297 def __delitem__(self, key):
298 path = self._get_path(key)

Callers

nothing calls this directly

Calls 2

_get_pathMethod · 0.95
encodeMethod · 0.80

Tested by

no test coverage detected