예제 #1
0
파일: init.py 프로젝트: qykth-git/calibre
 def compare_format(self, book_id, fmt):
     db = self.current_db.new_api
     ofmt = fmt
     if fmt.startswith('ORIGINAL_'):
         fmt = fmt.partition('_')[-1]
     else:
         ofmt = 'ORIGINAL_' + fmt
     path1, path2 = db.format_abspath(book_id, ofmt), db.format_abspath(book_id, fmt)
     from calibre.gui2.tweak_book.diff.main import compare_books
     compare_books(path1, path2, parent=self, revert_msg=_('Restore %s') % ofmt, revert_callback=partial(
         self.iactions['Remove Books'].restore_format, book_id, ofmt), names=(ofmt, fmt))
예제 #2
0
파일: init.py 프로젝트: AEliu/calibre
 def compare_format(self, book_id, fmt):
     db = self.current_db.new_api
     ofmt = fmt
     if fmt.startswith('ORIGINAL_'):
         fmt = fmt.partition('_')[-1]
     else:
         ofmt = 'ORIGINAL_' + fmt
     path1, path2 = db.format_abspath(book_id, ofmt), db.format_abspath(book_id, fmt)
     from calibre.gui2.tweak_book.diff.main import compare_books
     compare_books(path1, path2, parent=self, revert_msg=_('Restore %s') % ofmt, revert_callback=partial(
         self.iactions['Remove Books'].restore_format, book_id, ofmt), names=(ofmt, fmt))