This commit is contained in:
Kovid Goyal 2018-07-04 17:59:10 +05:30
parent a516fabae1
commit a6c0be308a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
5 changed files with 11 additions and 15 deletions

View File

@ -199,7 +199,7 @@ class KINDLE(USBMS):
return bookmarked_books
def generate_annotation_html(self, bookmark):
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag, NavigableString
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
# Returns <div class="user_annotations"> ... </div>
last_read_location = bookmark.last_read_location
timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp)
@ -542,7 +542,7 @@ class KINDLE2(KINDLE):
else:
print("Invalid method choice for this book (%r), ignoring." % temp)
except:
print 'Could not retrieve override method choice, using default.'
print('Could not retrieve override method choice, using default.')
apnx_builder.write_apnx(filepath, apnx_path, method=method, page_count=custom_page_count)
except:
print 'Failed to generate APNX'

View File

@ -477,8 +477,8 @@ class KOBO(USBMS):
cursor.close()
if ImageID is None:
print "Error condition ImageID was not found"
print "You likely tried to delete a book that the kobo has not yet added to the database"
print("Error condition ImageID was not found")
print("You likely tried to delete a book that the kobo has not yet added to the database")
# If all this succeeds we need to delete the images files via the ImageID
return ImageID
@ -1170,7 +1170,7 @@ class KOBO(USBMS):
def generate_annotation_html(self, bookmark):
import calendar
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag, NavigableString
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
# Returns <div class="user_annotations"> ... </div>
# last_read_location = bookmark.last_read_location
# timestamp = bookmark.timestamp

View File

@ -131,8 +131,7 @@ class CHMInput(InputFormatPlugin):
def unquote_path(x):
y = unquote(x)
if (not os.path.exists(os.path.join(base, x)) and
os.path.exists(os.path.join(base, y))):
if (not os.path.exists(os.path.join(base, x)) and os.path.exists(os.path.join(base, y))):
x = y
return x
@ -144,8 +143,7 @@ class CHMInput(InputFormatPlugin):
raw = unquote_path(child.href or '')
rsrcname = os.path.basename(raw)
rsrcpath = os.path.join(subpath, rsrcname)
if (not os.path.exists(os.path.join(base, rsrcpath)) and
os.path.exists(os.path.join(base, raw))):
if (not os.path.exists(os.path.join(base, rsrcpath)) and os.path.exists(os.path.join(base, raw))):
rsrcpath = raw
if '%' not in rsrcpath:

View File

@ -92,8 +92,7 @@ class HTMLInput(InputFormatPlugin):
return self._is_case_sensitive
if not path or not os.path.exists(path):
return islinux or isbsd
self._is_case_sensitive = not (os.path.exists(path.lower()) and
os.path.exists(path.upper()))
self._is_case_sensitive = not (os.path.exists(path.lower()) and os.path.exists(path.upper()))
return self._is_case_sensitive
def create_oebbook(self, htmlpath, basedir, opts, log, mi):

View File

@ -57,9 +57,8 @@ class OEBOutput(OutputFormatPlugin):
for item in oeb_book.manifest:
if (
not self.opts.expand_css and
item.media_type in OEB_STYLES and hasattr(item.data, 'cssText') and
'nook' not in self.opts.output_profile.short_name):
not self.opts.expand_css and item.media_type in OEB_STYLES and hasattr(
item.data, 'cssText') and 'nook' not in self.opts.output_profile.short_name):
condense_sheet(item.data)
path = os.path.abspath(unquote(item.href))
dir = os.path.dirname(path)