def _write_header(self):
if "<STR_LIT>" not in self.file_headers:<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL>self.file_headers['<STR_LIT>'] = "<STR_LIT>"<EOL><DEDENT>if "<STR_LIT:date>" not in self.file_headers:<EOL><INDENT>now = datetime.datetime.utcnow()<EOL>warnings.warn("<STR_LIT>"%now)<EOL>self.file_headers['<STR_LIT:date>'] = now<EOL><DEDENT>if "<STR_LIT>" not in self.file_headers:<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL>self.file_headers['<STR_LIT>'] = "<STR_LIT:127.0.0.1>"<EOL><DEDENT>if self.version == <NUM_LIT:1>:<EOL><INDENT>payload = "<STR_LIT>"%dict(org = self.file_headers['<STR_LIT>'])<EOL><DEDENT>elif self.version == <NUM_LIT:2>:<EOL><INDENT>payload = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>raise IOError("<STR_LIT>"%self.version)<EOL><DEDENT>fname = os.path.basename(self.fileobj.name)<EOL>header = ARCHeader(url = "<STR_LIT>"%fname,<EOL>ip_address = self.file_headers['<STR_LIT>'], <EOL>date = self.file_headers['<STR_LIT:date>'],<EOL>content_type = "<STR_LIT>", <EOL>length = len(payload),<EOL>result_code = "<STR_LIT>",<EOL>checksum = "<STR_LIT:->", <EOL>location = "<STR_LIT:->",<EOL>offset = str(self.fileobj.tell()),<EOL>filename = fname)<EOL>arc_file_header_record = ARCRecord(header, payload%self.file_headers)<EOL>self.write(arc_file_header_record)<EOL>
Writes out an ARC header