MCPcopy Index your code
hub / github.com/ipython/ipython / hdict

Method hdict

IPython/external/pickleshare.py:150–171  ·  view source on GitHub ↗

Get all data contained in hashed category 'hashroot' as dict

(self, hashroot)

Source from the content-addressed store, hash-verified

148 return d.get(key, default)
149
150 def hdict(self, hashroot):
151 """Get all data contained in hashed category 'hashroot' as dict"""
152 hfiles = self.keys(hashroot + "/*")
153 hfiles.sort()
154 last = len(hfiles) and hfiles[-1] or ""
155 if last.endswith("xx"):
156 # print "using xx"
157 hfiles = [last] + hfiles[:-1]
158
159 all = {}
160
161 for f in hfiles:
162 # print "using",f
163 try:
164 all.update(self[f])
165 except KeyError:
166 print("Corrupt", f, "deleted - hset is not threadsafe!")
167 del self[f]
168
169 self.uncache(f)
170
171 return all
172
173 def hcompress(self, hashroot):
174 """Compress category 'hashroot', so hset is fast again

Callers 1

hgetMethod · 0.95

Calls 4

keysMethod · 0.95
uncacheMethod · 0.95
sortMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected