mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Minor modifications to Nicebooks/Fictionwise
This commit is contained in:
parent
8f7bc53128
commit
a743464987
@ -69,6 +69,7 @@ class BrowserThread(Thread):
|
|||||||
if '<title>404 - ' in raw:
|
if '<title>404 - ' in raw:
|
||||||
report(self.verbose)
|
report(self.verbose)
|
||||||
self.result = None
|
self.result = None
|
||||||
|
return None
|
||||||
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
||||||
resolve_entities=True)[0]
|
resolve_entities=True)[0]
|
||||||
try:
|
try:
|
||||||
@ -137,12 +138,12 @@ class Query(object):
|
|||||||
report(verbose)
|
report(verbose)
|
||||||
if callable(getattr(e, 'getcode', None)) and \
|
if callable(getattr(e, 'getcode', None)) and \
|
||||||
e.getcode() == 404:
|
e.getcode() == 404:
|
||||||
return
|
return None
|
||||||
if isinstance(getattr(e, 'args', [None])[0], socket.timeout):
|
if isinstance(getattr(e, 'args', [None])[0], socket.timeout):
|
||||||
raise FictionwiseError(_('Fictionwise timed out. Try again later.'))
|
raise FictionwiseError(_('Fictionwise timed out. Try again later.'))
|
||||||
raise FictionwiseError(_('Fictionwise encountered an error.'))
|
raise FictionwiseError(_('Fictionwise encountered an error.'))
|
||||||
if '<title>404 - ' in raw:
|
if '<title>404 - ' in raw:
|
||||||
return
|
return None
|
||||||
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
||||||
resolve_entities=True)[0]
|
resolve_entities=True)[0]
|
||||||
try:
|
try:
|
||||||
|
@ -108,6 +108,7 @@ class BrowserThread(Thread):
|
|||||||
if '<title>404 - ' in raw:
|
if '<title>404 - ' in raw:
|
||||||
report(self.verbose)
|
report(self.verbose)
|
||||||
self.result = None
|
self.result = None
|
||||||
|
return None
|
||||||
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
raw = xml_to_unicode(raw, strip_encoding_pats=True,
|
||||||
resolve_entities=True)[0]
|
resolve_entities=True)[0]
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user