def __get_file_buffer(self, path): # {{{3
    if path in self.buffers:
      return self.buffers[path]
    else:
      buf = Buffer()
      inode = self.__path2keys(path)[1]
      query = """ SELECT h.hash FROM hashes h, "index" i
                  WHERE i.inode = ? AND h.id = i.hash_id
                  ORDER BY i.block_nr ASC """
      for row in self.conn.execute(query, (inode,)).fetchall():
        # TODO Make the file system more robust against failure by doing
        # something sensible when self.blocks.has_key(digest) is false.
        buf.write(self.decompress(self.blocks[str(row[0])]))
      self.buffers[path] = buf
      return buf
dataset/ETHPy150Open xolox/dedupfs/dedupfs.py/DedupFS.__get_file_buffer/original