mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
py3: fix unicode type
This commit is contained in:
parent
b4feb0153d
commit
93e93dee92
6 changed files with 11 additions and 9 deletions
|
|
@ -28,6 +28,7 @@ from calibre.gui2.actions import menu_action_unique_name
|
|||
from calibre.gui2.keyboard import ShortcutConfig
|
||||
from calibre.utils.config import config_dir
|
||||
from calibre.utils.date import now, format_date, qt_to_dt, UNDEFINED_DATE
|
||||
from .fanficfare.six import text_type as unicode
|
||||
|
||||
# Global definition of our plugin name. Used for common functions that require this.
|
||||
plugin_name = None
|
||||
|
|
@ -615,4 +616,3 @@ class PrefsViewerDialog(SizePersistedDialog):
|
|||
self.close()
|
||||
if d.do_restart:
|
||||
self.gui.quit(restart=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ else:
|
|||
from calibre.gui2 import dynamic, info_dialog, question_dialog
|
||||
from calibre.gui2.ui import get_gui
|
||||
from calibre.gui2.complete2 import EditWithComplete
|
||||
from .fanficfare.six import text_type as unicode
|
||||
|
||||
try:
|
||||
from calibre.ebooks.covers import generate_cover as cal_generate_cover
|
||||
|
|
@ -1667,5 +1668,3 @@ class ImapTab(QWidget):
|
|||
self.l.addWidget(label,row,0,1,-1,Qt.AlignTop)
|
||||
self.l.setRowStretch(row,1)
|
||||
row+=1
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ from calibre.gui2 import gprefs
|
|||
show_download_options = 'fff:add new/update dialogs:show_download_options'
|
||||
from calibre.gui2.dialogs.confirm_delete import confirm
|
||||
from calibre.gui2.complete2 import EditWithComplete
|
||||
from .fanficfare.six import text_type as unicode
|
||||
|
||||
# pulls in translation files for _() strings
|
||||
try:
|
||||
|
|
@ -707,7 +708,7 @@ class _LoopProgressDialog(QProgressDialog):
|
|||
book['good']=False
|
||||
book['status']=_("Error")
|
||||
book['comment']=unicode(e)
|
||||
logger.error("Exception: %s:%s"%(book,unicode(e)),exc_info=True)
|
||||
logger.error("Exception: %s:%s"%(book,book['comment']),exc_info=True)
|
||||
|
||||
self.updateStatus()
|
||||
self.i += 1
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ __license__ = 'GPL v3'
|
|||
__copyright__ = '2019, Jim Miller'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from .fanficfare.six import text_type as unicode
|
||||
|
||||
# import cProfile
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from calibre.utils.ipc.server import Server
|
|||
from calibre.utils.ipc.job import ParallelJob
|
||||
from calibre.constants import numeric_version as calibre_version
|
||||
from calibre.utils.date import local_tz
|
||||
from .fanficfare.six import text_type as unicode
|
||||
|
||||
from calibre_plugins.fanficfare_plugin.wordcount import get_word_count
|
||||
from calibre_plugins.fanficfare_plugin.prefs import (SAVE_YES, SAVE_YES_UNLESS_SITE)
|
||||
|
|
@ -341,7 +342,7 @@ def do_download_for_worker(book,options,merge,notification=lambda x,y:x):
|
|||
book['comment']=unicode(e)
|
||||
book['icon']='dialog_error.png'
|
||||
book['status'] = _('Error')
|
||||
logger.info("Exception: %s:%s"%(book,unicode(e)),exc_info=True)
|
||||
logger.info("Exception: %s:%s"%(book,book['comment']),exc_info=True)
|
||||
|
||||
#time.sleep(10)
|
||||
return book
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ logger = logging.getLogger(__name__)
|
|||
import re
|
||||
|
||||
from calibre.ebooks.oeb.iterator import EbookIterator
|
||||
from .fanficfare.six import text_type as unicode
|
||||
|
||||
RE_HTML_BODY = re.compile(u'<body[^>]*>(.*)</body>', re.UNICODE | re.DOTALL | re.IGNORECASE)
|
||||
RE_STRIP_MARKUP = re.compile(u'<[^>]+>', re.UNICODE)
|
||||
|
|
@ -92,4 +93,3 @@ def _extract_body_text(data):
|
|||
if body:
|
||||
return RE_STRIP_MARKUP.sub('', body[0]).replace('.','. ')
|
||||
return ''
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue