def _readMetaAndContent(self,fid):
found_meta_separator=False<EOL>d={}<EOL>while found_meta_separator is False:<EOL><INDENT>line = fid.readline()<EOL>if line[<NUM_LIT:0>:len(self.META_SEPARATOR)]==self.META_SEPARATOR:<EOL><INDENT>found_meta_separator=True<EOL><DEDENT>else:<EOL><INDENT>key=line.split('<STR_LIT::>')[<NUM_LIT:0>].strip().lower()<EOL>if key in self.WP_META_KEYS:<EOL><INDENT>d[key]=line.split('<STR_LIT::>')[<NUM_LIT:1>].strip()<EOL><DEDENT>else:<EOL><INDENT>logger.error("<STR_LIT>"%(key,self.WP_META_KEYS))<EOL>return None<EOL><DEDENT><DEDENT><DEDENT>if not d.has_key('<STR_LIT:title>'):<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>d['<STR_LIT:content>']=fid.readlines()<EOL>d['<STR_LIT:content>']='<STR_LIT>'.join(d['<STR_LIT:content>'])<EOL>post = WordPressPost()<EOL>post.title=d['<STR_LIT:title>']<EOL>post.content=d['<STR_LIT:content>']<EOL>post.post_status='<STR_LIT>'<EOL>post.terms_names={}<EOL>if d.has_key('<STR_LIT>'):<EOL><INDENT>post.terms_names['<STR_LIT>']=d['<STR_LIT>'].split('<STR_LIT:U+002C>')<EOL><DEDENT>if d.has_key('<STR_LIT>'):<EOL><INDENT>post.terms_names['<STR_LIT>']=d['<STR_LIT>'].split('<STR_LIT:U+002C>')<EOL><DEDENT>return post<EOL>
Reads meta data and content from file into WordPressPost() class.
        Returns the class

        If error, returns None