def import_authors(self, tree):
self.write_out(self.style.STEP('<STR_LIT>'))<EOL>post_authors = set()<EOL>for item in tree.findall('<STR_LIT>'):<EOL><INDENT>post_type = item.find('<STR_LIT>' % WP_NS).text<EOL>if post_type == '<STR_LIT>':<EOL><INDENT>post_authors.add(item.find(<EOL>'<STR_LIT>').text)<EOL><DEDENT><DEDENT>self.write_out('<STR_LIT>' % len(post_authors))<EOL>authors = {}<EOL>for post_author in post_authors:<EOL><INDENT>if self.default_author:<EOL><INDENT>authors[post_author] = self.default_author<EOL><DEDENT>else:<EOL><INDENT>authors[post_author] = self.migrate_author(<EOL>post_author.replace('<STR_LIT:U+0020>', '<STR_LIT:->'))<EOL><DEDENT><DEDENT>return authors<EOL>
Retrieve all the authors used in posts
and convert it to new or existing author and
return the conversion.