MCPcopy Index your code
hub / github.com/RustPython/RustPython / _addkey

Method _addkey

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

Source from the content-addressed store, hash-verified

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