MCPcopy Index your code
hub / github.com/python/cpython / _addkey

Method _addkey

Lib/dbm/dumb.py:181–185  ·  view source on GitHub ↗
(self, key, pos_and_siz_pair)

Source from the content-addressed store, hash-verified

179 # at offset pos and with length siz. Add an index record to
180 # the in-memory index dict, and append one to the directory file.
181 def _addkey(self, key, pos_and_siz_pair):
182 self._index[key] = pos_and_siz_pair
183 with _io.open(self._dirfile, 'a', encoding="Latin-1") as f:
184 self._chmod(self._dirfile)
185 f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair))
186
187 def __setitem__(self, key, val):
188 if self._readonly:

Callers 1

__setitem__Method · 0.95

Calls 4

_chmodMethod · 0.95
openMethod · 0.45
writeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected