parenthesize chained operators (extra-edit)

This commit is contained in:
un-pogaz 2025-01-24 11:14:19 +01:00
parent 76c091c975
commit 537ea5ef34
3 changed files with 9 additions and 10 deletions

View File

@ -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)

View File

@ -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

View File

@ -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 (
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))):
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)