def merge_article_book_list(self): book_list = self.book_list[Type.article] book = InitialBook() answer = [item.sql.answer for item in book_list] info = [item.sql.info for item in book_list] book.kind = Type.article book.sql.info = 'select * from Article where ({})'.format(' or '.join(info)) book.sql.answer = 'select * from Article where ({})'.format(' or '.join(answer)) self.book_list[Type.article] = [book] return
def merge_article_book_list(self): book_list = self.book_list[Type.article] book = InitialBook() answer = [item.sql.answer for item in book_list] info = [item.sql.info for item in book_list] book.kind = Type.article book.sql.info = 'select * from Article where ({})'.format( ' or '.join(info)) book.sql.answer = 'select * from Article where ({})'.format( ' or '.join(answer)) self.book_list[Type.article] = [book] return
def merge_csdnblog_article_book_list(self, book_type): book_list = self.book_list[Type.csdnblog_author] book = InitialBook() info_extra = [item.sql.info_extra for item in book_list] article_extra = [item.sql.article_extra for item in book_list] book.kind = book_type book.author_id = '_'.join([item.author_id for item in book_list]) book.sql.info = 'select * from csdnblog_info where ({})'.format(' or '.join(info_extra)) book.sql.article = 'select * from csdnblog_article where ({})'.format(' or '.join(article_extra)) book.sql.answer = 'select * from csdnblog_article where ({})'.format(' or '.join(article_extra)) self.book_list[book_type] = [book] return
def merge_question_book_list(self, book_type): book_list = self.book_list[book_type] book = InitialBook() question = [item.sql.question for item in book_list] answer = [item.sql.answer for item in book_list] info = [item.sql.info for item in book_list] book.kind = book_type book.sql.info = 'select * from Question where ({})'.format(' or '.join(info)) book.sql.question = 'select * from Question where ({})'.format(' or '.join(question)) book.sql.answer = 'select * from Answer where ({})'.format(' or '.join(answer)) self.book_list[book_type] = [book] return
def merge_sinablog_article_book_list(self, book_type): book_list = self.book_list[Type.sinablog_author] book = InitialBook() info_extra = [item.sql.info_extra for item in book_list] article_extra = [item.sql.article_extra for item in book_list] book.kind = book_type book.author_id = '_'.join([item.author_id for item in book_list]) book.sql.info = 'select * from sinablog_info where ({})'.format( ' or '.join(info_extra)) book.sql.article = 'select * from sinablog_article where ({})'.format( ' or '.join(article_extra)) book.sql.answer = 'select * from sinablog_article where ({})'.format( ' or '.join(article_extra)) self.book_list[book_type] = [book] return
def merge_question_book_list(self, book_type): book_list = self.book_list[book_type] book = InitialBook() question = [item.sql.question for item in book_list] answer = [item.sql.answer for item in book_list] info = [item.sql.info for item in book_list] book.kind = book_type book.sql.info = 'select * from Question where ({})'.format( ' or '.join(info)) book.sql.question = 'select * from Question where ({})'.format( ' or '.join(question)) book.sql.answer = 'select * from Answer where ({})'.format( ' or '.join(answer)) self.book_list[book_type] = [book] return
def __init__(self): self.kind = '' self.spider = Spider() self.book = InitialBook() return