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

Method hcompress

IPython/external/pickleshare.py:173–192  ·  view source on GitHub ↗

Compress category 'hashroot', so hset is fast again hget will fail if fast_only is True for compressed items (that were hset before hcompress).

(self, hashroot)

Source from the content-addressed store, hash-verified

171 return all
172
173 def hcompress(self, hashroot):
174 """Compress category 'hashroot', so hset is fast again
175
176 hget will fail if fast_only is True for compressed items (that were
177 hset before hcompress).
178
179 """
180 hfiles = self.keys(hashroot + "/*")
181 all = {}
182 for f in hfiles:
183 # print "using",f
184 all.update(self[f])
185 self.uncache(f)
186
187 self[hashroot + "/xx"] = all
188 for f in hfiles:
189 p = self.root / f
190 if p.name == "xx":
191 continue
192 p.unlink()
193
194 def __delitem__(self, key):
195 """del db["key"]"""

Callers

nothing calls this directly

Calls 3

keysMethod · 0.95
uncacheMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected