diff --git a/src/calibre/ebooks/oeb/iterator/book.py b/src/calibre/ebooks/oeb/iterator/book.py index 9dce2c9561..cede2cfc19 100644 --- a/src/calibre/ebooks/oeb/iterator/book.py +++ b/src/calibre/ebooks/oeb/iterator/book.py @@ -67,8 +67,7 @@ def extract_book(pathtoebook, tdir, log=None, view_kepub=False, processed=False, if not only_input_plugin: # Run the HTML preprocess/parsing from the conversion pipeline as # well - if (processed or (plumber.input_fmt.lower() in {'pdb', 'pdf', 'rb'} and - not hasattr(pathtoopf, 'manifest'))): + if processed or (plumber.input_fmt.lower() in {'pdb', 'pdf', 'rb'} and not hasattr(pathtoopf, 'manifest')): if hasattr(pathtoopf, 'manifest'): pathtoopf = write_oebbook(pathtoopf, tdir) pathtoopf = create_oebbook(log, pathtoopf, plumber.opts) diff --git a/src/calibre/ebooks/oeb/transforms/page_margin.py b/src/calibre/ebooks/oeb/transforms/page_margin.py index 46906a5847..804be2ce60 100644 --- a/src/calibre/ebooks/oeb/transforms/page_margin.py +++ b/src/calibre/ebooks/oeb/transforms/page_margin.py @@ -88,8 +88,7 @@ class RemoveFakeMargins: except: pass else: - if ((hasattr(ti, 'startswith') and ti.startswith('-')) or - (isinstance(ti, numbers.Number) and ti < 0)): + if ((hasattr(ti, 'startswith') and ti.startswith('-')) or (isinstance(ti, numbers.Number) and ti < 0)): raise NegativeTextIndent() return style.marginLeft, style.marginRight, style return '', '', None diff --git a/src/calibre/gui2/tag_browser/model.py b/src/calibre/gui2/tag_browser/model.py index 46abeb70a9..579a94bca1 100644 --- a/src/calibre/gui2/tag_browser/model.py +++ b/src/calibre/gui2/tag_browser/model.py @@ -1233,12 +1233,13 @@ class TagsModel(QAbstractItemModel): # {{{ fm_dest = self.db.metadata_for_field(node.category_key) if fm_dest['kind'] == 'user': fm_src = self.db.metadata_for_field(md.column_name) - if md.column_name in ['authors', 'publisher', 'series'] or \ - ((fm_src['is_custom'] and ( - fm_src['datatype'] in ['series', 'text', 'enumeration'] and - not fm_src['is_multiple']))or - (fm_src['datatype'] == 'composite' and - fm_src['display'].get('make_category', False))): + if md.column_name in ['authors', 'publisher', 'series'] or ( + (fm_src['is_custom'] and ( + fm_src['datatype'] in ['series', 'text', 'enumeration'] and + not fm_src['is_multiple'])) or + (fm_src['datatype'] == 'composite' and + fm_src['display'].get('make_category', False)) + ): mime = 'application/calibre+from_library' ids = list(map(int, md.data(mime).data().split())) self.handle_user_category_drop(node, ids, md.column_name)