mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-22 15:44:59 +00:00
PEP8: Line break before binary operator
This commit is contained in:
@@ -65,10 +65,10 @@ def upgrade_to_v1_0_0_final_0():
|
||||
"merged with that of single artist albums."),
|
||||
QtWidgets.QMessageBox.Ok)
|
||||
|
||||
elif (_s.value("va_file_naming_format", config.TextOption) !=
|
||||
r"$if2(%albumartist%,%artist%)/%album%/$if($gt(%totaldis"
|
||||
"cs%,1),%discnumber%-,)$num(%tracknumber%,2) %artist% - "
|
||||
"%title%"):
|
||||
elif (_s.value("va_file_naming_format", config.TextOption)
|
||||
!= r"$if2(%albumartist%,%artist%)/%album%/$if($gt(%totaldis"
|
||||
"cs%,1),%discnumber%-,)$num(%tracknumber%,2) %artist% - "
|
||||
"%title%"):
|
||||
|
||||
msgbox.setWindowTitle(_("Various Artists file naming scheme removal"))
|
||||
msgbox.setText(_("The separate file naming scheme for various artists "
|
||||
@@ -91,7 +91,6 @@ def upgrade_to_v1_0_0_final_0():
|
||||
def upgrade_to_v1_3_0_dev_1():
|
||||
"""Option "windows_compatible_filenames" was renamed "windows_compatibility" (PICARD-110).
|
||||
"""
|
||||
_s = config.setting
|
||||
old_opt = "windows_compatible_filenames"
|
||||
new_opt = "windows_compatibility"
|
||||
rename_option(old_opt, new_opt, config.BoolOption, True)
|
||||
|
||||
@@ -129,10 +129,10 @@ class CoverArt:
|
||||
# album removed
|
||||
return
|
||||
|
||||
if (self.front_image_found and
|
||||
config.setting["save_images_to_tags"] and not
|
||||
config.setting["save_images_to_files"] and
|
||||
config.setting["embed_only_one_front_image"]):
|
||||
if (self.front_image_found
|
||||
and config.setting["save_images_to_tags"]
|
||||
and not config.setting["save_images_to_files"]
|
||||
and config.setting["embed_only_one_front_image"]):
|
||||
# no need to continue
|
||||
self.album._finalize_loading(None)
|
||||
return
|
||||
|
||||
@@ -293,8 +293,8 @@ class CoverArtImage:
|
||||
"""
|
||||
if not self.can_be_saved_to_disk:
|
||||
return
|
||||
if (config.setting["caa_image_type_as_filename"] and
|
||||
not self.is_front_image()):
|
||||
if (config.setting["caa_image_type_as_filename"]
|
||||
and not self.is_front_image()):
|
||||
filename = self.maintype
|
||||
log.debug("Make cover filename from types: %r -> %r",
|
||||
self.types, filename)
|
||||
|
||||
@@ -259,8 +259,8 @@ class ID3File(File):
|
||||
name = self.__rename_freetext[name]
|
||||
if name in self.__translate_freetext:
|
||||
name = self.__translate_freetext[name]
|
||||
elif ((name in self.__rtranslate) !=
|
||||
(name in self.__rtranslate_freetext)):
|
||||
elif ((name in self.__rtranslate)
|
||||
!= (name in self.__rtranslate_freetext)):
|
||||
# If the desc of a TXXX frame conflicts with the name of a
|
||||
# Picard tag, load it into ~id3:TXXX:desc rather than desc.
|
||||
#
|
||||
|
||||
@@ -95,8 +95,8 @@ class Metadata(MutableMapping):
|
||||
|
||||
@staticmethod
|
||||
def length_score(a, b):
|
||||
return (1.0 - min(abs(a - b), LENGTH_SCORE_THRES_MS) /
|
||||
float(LENGTH_SCORE_THRES_MS))
|
||||
return (1.0 - min(abs(a - b),
|
||||
LENGTH_SCORE_THRES_MS) / float(LENGTH_SCORE_THRES_MS))
|
||||
|
||||
def compare(self, other):
|
||||
parts = []
|
||||
|
||||
@@ -344,9 +344,9 @@ def _get_multi_values(parser, multi, separator):
|
||||
|
||||
if separator == MULTI_VALUED_JOINER:
|
||||
# Convert ScriptExpression containing only a single variable into variable
|
||||
if (isinstance(multi, ScriptExpression) and
|
||||
len(multi) == 1 and
|
||||
isinstance(multi[0], ScriptVariable)):
|
||||
if (isinstance(multi, ScriptExpression)
|
||||
and len(multi) == 1
|
||||
and isinstance(multi[0], ScriptVariable)):
|
||||
multi = multi[0]
|
||||
|
||||
# If a variable, return multi-values
|
||||
|
||||
@@ -166,8 +166,9 @@ class ReleasesOptionsPage(OptionsPage):
|
||||
label,
|
||||
next(griditer))
|
||||
|
||||
griditer = RowColIter(len(RELEASE_PRIMARY_GROUPS) +
|
||||
len(RELEASE_SECONDARY_GROUPS) + 1) # +1 for Reset button
|
||||
griditer = RowColIter(len(RELEASE_PRIMARY_GROUPS)
|
||||
+ len(RELEASE_SECONDARY_GROUPS)
|
||||
+ 1) # +1 for Reset button
|
||||
for name in RELEASE_PRIMARY_GROUPS:
|
||||
add_slider(name, griditer, context='release_group_primary_type')
|
||||
for name in sorted(RELEASE_SECONDARY_GROUPS,
|
||||
|
||||
@@ -47,8 +47,9 @@ def escape_lucene_query(text):
|
||||
|
||||
|
||||
def _wrap_xml_metadata(data):
|
||||
return ('<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#">%s</metadata>' % data)
|
||||
return ('<?xml version="1.0" encoding="UTF-8"?>'
|
||||
'<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#">%s</metadata>'
|
||||
% data)
|
||||
|
||||
|
||||
class APIHelper(object):
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# E265: block comment should start with ‘# ‘
|
||||
# E402: module level import not at top of file
|
||||
# E501: line too long (xx > 79 characters)
|
||||
ignore = E127,E128,E265,E402,E501
|
||||
# W503: line break occurred before a binary operator
|
||||
ignore = E127,E128,E265,E402,E501,W503
|
||||
builtins = _,N_,ngettext,gettext_attributes,gettext_countries,string_
|
||||
exclude = ui_*.py
|
||||
|
||||
|
||||
Reference in New Issue
Block a user