mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
ebda738c81
commit
19d7f6d39f
@ -21,7 +21,7 @@ from calibre.customize.conversion import InputFormatPlugin
|
|||||||
from calibre.ebooks.chardet import xml_to_unicode
|
from calibre.ebooks.chardet import xml_to_unicode
|
||||||
from calibre.customize.conversion import OptionRecommendation
|
from calibre.customize.conversion import OptionRecommendation
|
||||||
from calibre.constants import islinux, isfreebsd, iswindows
|
from calibre.constants import islinux, isfreebsd, iswindows
|
||||||
from calibre import unicode_path
|
from calibre import unicode_path, as_unicode
|
||||||
from calibre.utils.localization import get_lang
|
from calibre.utils.localization import get_lang
|
||||||
from calibre.utils.filenames import ascii_filename
|
from calibre.utils.filenames import ascii_filename
|
||||||
from calibre.ebooks.conversion.utils import PreProcessor
|
from calibre.ebooks.conversion.utils import PreProcessor
|
||||||
@ -112,7 +112,7 @@ class HTMLFile(object):
|
|||||||
with open(self.path, 'rb') as f:
|
with open(self.path, 'rb') as f:
|
||||||
src = f.read()
|
src = f.read()
|
||||||
except IOError, err:
|
except IOError, err:
|
||||||
msg = 'Could not read from file: %s with error: %s'%(self.path, unicode(err))
|
msg = 'Could not read from file: %s with error: %s'%(self.path, as_unicode(err))
|
||||||
if level == 0:
|
if level == 0:
|
||||||
raise IOError(msg)
|
raise IOError(msg)
|
||||||
raise IgnoreFile(msg, err.errno)
|
raise IgnoreFile(msg, err.errno)
|
||||||
|
@ -52,7 +52,7 @@ def is_date_undefined(qt_or_dt):
|
|||||||
return True
|
return True
|
||||||
if hasattr(d, 'toString'):
|
if hasattr(d, 'toString'):
|
||||||
d = datetime(d.year(), d.month(), d.day(), tzinfo=utc_tz)
|
d = datetime(d.year(), d.month(), d.day(), tzinfo=utc_tz)
|
||||||
return d.year == UNDEFINED_DATE.year and \
|
return d.year <= UNDEFINED_DATE.year and \
|
||||||
d.month == UNDEFINED_DATE.month and \
|
d.month == UNDEFINED_DATE.month and \
|
||||||
d.day == UNDEFINED_DATE.day
|
d.day == UNDEFINED_DATE.day
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user