diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py
index 1c84c42e90..c6635a873f 100644
--- a/src/calibre/devices/kindle/driver.py
+++ b/src/calibre/devices/kindle/driver.py
@@ -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
...
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'
diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py
index 629f1bd755..cbc4c2e6d1 100644
--- a/src/calibre/devices/kobo/driver.py
+++ b/src/calibre/devices/kobo/driver.py
@@ -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 ...
# last_read_location = bookmark.last_read_location
# timestamp = bookmark.timestamp
diff --git a/src/calibre/ebooks/conversion/plugins/chm_input.py b/src/calibre/ebooks/conversion/plugins/chm_input.py
index efc91d7704..911418f801 100644
--- a/src/calibre/ebooks/conversion/plugins/chm_input.py
+++ b/src/calibre/ebooks/conversion/plugins/chm_input.py
@@ -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:
diff --git a/src/calibre/ebooks/conversion/plugins/html_input.py b/src/calibre/ebooks/conversion/plugins/html_input.py
index 2ebd7f6433..fa9329fc40 100644
--- a/src/calibre/ebooks/conversion/plugins/html_input.py
+++ b/src/calibre/ebooks/conversion/plugins/html_input.py
@@ -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):
diff --git a/src/calibre/ebooks/conversion/plugins/oeb_output.py b/src/calibre/ebooks/conversion/plugins/oeb_output.py
index 802f6f106a..92d9e375bb 100644
--- a/src/calibre/ebooks/conversion/plugins/oeb_output.py
+++ b/src/calibre/ebooks/conversion/plugins/oeb_output.py
@@ -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)