mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
Fixes #1968897 [Edit Metadata: Google identifiers paste as url:](https://bugs.launchpad.net/calibre/+bug/1968897)
This commit is contained in:
parent
2b40d1dbfb
commit
205db05475
@ -3223,14 +3223,15 @@ class KOBOTOUCH(KOBO):
|
|||||||
debug_print("KoboTouch:generate_update_from_template template error - template='%s'" % template)
|
debug_print("KoboTouch:generate_update_from_template template error - template='%s'" % template)
|
||||||
debug_print("KoboTouch:generate_update_from_template - new_value=", new_value)
|
debug_print("KoboTouch:generate_update_from_template - new_value=", new_value)
|
||||||
|
|
||||||
debug_print(f"KoboTouch:generate_update_from_template - {book.title} - column_name='{column_name}', current_value='{current_value}', new_value='{new_value}'")
|
debug_print(
|
||||||
if (new_value is not None and \
|
f"KoboTouch:generate_update_from_template - {book.title} - column_name='{column_name}',"
|
||||||
|
f" current_value='{current_value}', new_value='{new_value}'")
|
||||||
|
if (new_value is not None and
|
||||||
(current_value is None or new_value != current_value)) or \
|
(current_value is None or new_value != current_value)) or \
|
||||||
(new_value is None and current_value is not None):
|
(new_value is None and current_value is not None):
|
||||||
update_values.append(new_value)
|
update_values.append(new_value)
|
||||||
set_clause.append(column_name)
|
set_clause.append(column_name)
|
||||||
|
|
||||||
|
|
||||||
plugboard = None
|
plugboard = None
|
||||||
if self.plugboard_func and not series_only:
|
if self.plugboard_func and not series_only:
|
||||||
if book.contentID.endswith('.kepub.epub') or not os.path.splitext(book.contentID)[1]:
|
if book.contentID.endswith('.kepub.epub') or not os.path.splitext(book.contentID)[1]:
|
||||||
@ -3427,7 +3428,6 @@ class KOBOTOUCH(KOBO):
|
|||||||
if show_debug:
|
if show_debug:
|
||||||
debug_print("KoboTouch:set_core_metadata - end")
|
debug_print("KoboTouch:set_core_metadata - end")
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def config_widget(cls):
|
def config_widget(cls):
|
||||||
# TODO: Cleanup the following
|
# TODO: Cleanup the following
|
||||||
|
@ -693,15 +693,19 @@ class MetadataGroupBox(DeviceOptionsGroupBox):
|
|||||||
@property
|
@property
|
||||||
def update_bookstats(self):
|
def update_bookstats(self):
|
||||||
return self.update_bookstats_checkbox.isChecked()
|
return self.update_bookstats_checkbox.isChecked()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bookstats_pagecount_template(self):
|
def bookstats_pagecount_template(self):
|
||||||
return self.bookstats_pagecount_template_edit.template
|
return self.bookstats_pagecount_template_edit.template
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bookstats_wordcount_template(self):
|
def bookstats_wordcount_template(self):
|
||||||
return self.bookstats_wordcount_template_edit.template
|
return self.bookstats_wordcount_template_edit.template
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bookstats_timetoread_lower_template(self):
|
def bookstats_timetoread_lower_template(self):
|
||||||
return self.bookstats_timetoread_lower_template_edit.template
|
return self.bookstats_timetoread_lower_template_edit.template
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bookstats_timetoread_upper_template(self):
|
def bookstats_timetoread_upper_template(self):
|
||||||
return self.bookstats_timetoread_upper_template_edit.template
|
return self.bookstats_timetoread_upper_template_edit.template
|
||||||
@ -709,6 +713,7 @@ class MetadataGroupBox(DeviceOptionsGroupBox):
|
|||||||
|
|
||||||
from calibre.gui2.dialogs.template_line_editor import TemplateLineEditor
|
from calibre.gui2.dialogs.template_line_editor import TemplateLineEditor
|
||||||
|
|
||||||
|
|
||||||
class TemplateConfig(QWidget): # {{{
|
class TemplateConfig(QWidget): # {{{
|
||||||
|
|
||||||
def __init__(self, val, label=None, tooltip=None):
|
def __init__(self, val, label=None, tooltip=None):
|
||||||
|
@ -201,7 +201,7 @@ class GoogleBooks(Source):
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
def id_from_url(self, url): # {{{
|
def id_from_url(self, url): # {{{
|
||||||
url_pattern = '(?:http|https)://books\.google\.com/books\?id=(?P<id_>.+)'
|
url_pattern = r'(?:http|https)://books\.google\.com/books\?id=(?P<id_>.+)'
|
||||||
url_pattern = re.compile(url_pattern)
|
url_pattern = re.compile(url_pattern)
|
||||||
id_ = url_pattern.search(url).group('id_')
|
id_ = url_pattern.search(url).group('id_')
|
||||||
if id_:
|
if id_:
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from collections import defaultdict
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from qt.core import (QTimer, QApplication, Qt, QEvent, QDialog, QMenu, QIcon,
|
from qt.core import (QTimer, QApplication, Qt, QEvent, QDialog, QMenu, QIcon,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user