MCPcopy Create free account
hub / github.com/ElementsProject/elements / fetchBlock

Method fetchBlock

contrib/linearize/linearize-data.py:204–208  ·  view source on GitHub ↗

Fetch block contents from disk given extents

(self, extent)

Source from the content-addressed store, hash-verified

202 return os.path.join(self.settings['input'], "blk%05d.dat" % fn)
203
204 def fetchBlock(self, extent):
205 '''Fetch block contents from disk given extents'''
206 with open(self.inFileName(extent.fn), "rb") as f:
207 f.seek(extent.offset)
208 return f.read(extent.size)
209
210 def copyOneBlock(self):
211 '''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.45
readMethod · 0.45

Tested by

no test coverage detected