MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _update

Method _update

tools/python-3.11.9-amd64/Lib/dbm/dumb.py:93–108  ·  view source on GitHub ↗
(self, flag)

Source from the content-addressed store, hash-verified

91
92 # Read directory file into the in-memory index dict.
93 def _update(self, flag):
94 self._modified = False
95 self._index = {}
96 try:
97 f = _io.open(self._dirfile, 'r', encoding="Latin-1")
98 except OSError:
99 if flag not in ('c', 'n'):
100 raise
101 self._modified = True
102 else:
103 with f:
104 for line in f:
105 line = line.rstrip()
106 key, pos_and_siz_pair = _ast.literal_eval(line)
107 key = key.encode('Latin-1')
108 self._index[key] = pos_and_siz_pair
109
110 # Write the index dict to the directory file. The original directory
111 # file (if any) is renamed with a .bak extension first. If a .bak

Callers 1

__init__Method · 0.95

Calls 3

openMethod · 0.45
rstripMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected