def process_edition(self, edition): contributors = edition.author_contributors if contributors: primary_author = contributors[0] primary_author_name = primary_author.sort_name else: primary_author_name = None author = WorkIDCalculator.normalize_author(primary_author_name) if edition.subtitle: original_title = edition.title + u": " + edition.subtitle else: original_title = edition.title title = WorkIDCalculator.normalize_title(original_title) self.write_row(primary_author_name, author, original_title, title, "ebook")
def write_row(self, title, author, normalized_title, normalized_author, format): permanent_id = WorkIDCalculator.permanent_id( normalized_title, normalized_author, format) row = [title, author, normalized_title, normalized_author, format, permanent_id] self.writer.writerow(map(self.ready, row))
def write_row(self, title, author, normalized_title, normalized_author, format): permanent_id = WorkIDCalculator.permanent_id(normalized_title, normalized_author, format) row = [ title, author, normalized_title, normalized_author, format, permanent_id ] self.writer.writerow(map(self.ready, row))