MCPcopy Create free account
hub / github.com/LUX-Core/lux / fetchBlock

Method fetchBlock

contrib/linearize/linearize-data.py:170–174  ·  view source on GitHub ↗

Fetch block contents from disk given extents

(self, extent)

Source from the content-addressed store, hash-verified

168 return "%s/blk%05d.dat" % (self.settings['input'], fn)
169
170 def fetchBlock(self, extent):
171 '''Fetch block contents from disk given extents'''
172 with open(self.inFileName(extent.fn), "rb") as f:
173 f.seek(extent.offset)
174 return f.read(extent.size)
175
176 def copyOneBlock(self):
177 '''Find the next block to be written in the input, and copy it to the output.'''

Callers 1

copyOneBlockMethod · 0.95

Calls 3

inFileNameMethod · 0.95
seekMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected