mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
a516fabae1
commit
a6c0be308a
@ -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)
|
||||
@ -540,9 +540,9 @@ class KINDLE2(KINDLE):
|
||||
if temp in self.EXTRA_CUSTOMIZATION_CHOICES[self.OPT_APNX_METHOD]:
|
||||
method = temp
|
||||
else:
|
||||
print ("Invalid method choice for this book (%r), ignoring." % temp)
|
||||
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'
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user