def __init__(self, file): fh = open(file, 'rb') size = os.stat(file).st_size while fh.tell() < size: root_atom = Atom( stream=fh, offset=fh.tell() ) root_atom.seek( 0, os.SEEK_END ) self.append( root_atom )