def __init__(self, fp, seekable = <NUM_LIT:1>):
if seekable == <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>fp.tell()<EOL><DEDENT>except (AttributeError, IOError):<EOL><INDENT>seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>self.fp = fp<EOL>self.seekable = seekable<EOL>self.startofheaders = None<EOL>self.startofbody = None<EOL>if self.seekable:<EOL><INDENT>try:<EOL><INDENT>self.startofheaders = self.fp.tell()<EOL><DEDENT>except IOError:<EOL><INDENT>self.seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>self.readheaders()<EOL>if self.seekable:<EOL><INDENT>try:<EOL><INDENT>self.startofbody = self.fp.tell()<EOL><DEDENT>except IOError:<EOL><INDENT>self.seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>
Initialize the class instance and read the headers.