Do not use backslashes to deal with long strings

This commit is contained in:
Šarūnas Nejus 2025-08-07 11:46:10 +01:00
parent 1c16b2b308
commit 2fccf64efe
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
8 changed files with 31 additions and 31 deletions

View file

@ -143,8 +143,7 @@ def resize_image(log, imagepath, maxwidth, quality):
specified quality level. specified quality level.
""" """
log.debug( log.debug(
"Resizing album art to {0} pixels wide and encoding at quality \ "Resizing album art to {0} pixels wide and encoding at quality level {1}",
level {1}",
maxwidth, maxwidth,
quality, quality,
) )

View file

@ -1609,8 +1609,8 @@ def _ensure_db_directory_exists(path):
newpath = os.path.dirname(path) newpath = os.path.dirname(path)
if not os.path.isdir(newpath): if not os.path.isdir(newpath):
if input_yn( if input_yn(
f"The database directory {util.displayable_path(newpath)} does not \ f"The database directory {util.displayable_path(newpath)} does not"
exist. Create it (Y/n)?" " exist. Create it (Y/n)?"
): ):
os.makedirs(newpath) os.makedirs(newpath)

View file

@ -118,8 +118,10 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
dest="pretend_fetch", dest="pretend_fetch",
action="store_true", action="store_true",
default=False, default=False,
help="pretend to perform action, but show \ help=(
only files which would be processed", "pretend to perform action, but show only files which would be"
" processed"
),
) )
cmd.func = self.command cmd.func = self.command
return [cmd] return [cmd]

View file

@ -176,16 +176,17 @@ class ConvertPlugin(BeetsPlugin):
"--threads", "--threads",
action="store", action="store",
type="int", type="int",
help="change the number of threads, \ help=(
defaults to maximum available processors", "change the number of threads, defaults to maximum available"
" processors"
),
) )
cmd.parser.add_option( cmd.parser.add_option(
"-k", "-k",
"--keep-new", "--keep-new",
action="store_true", action="store_true",
dest="keep_new", dest="keep_new",
help="keep only the converted \ help="keep only the converted and move the old files",
and move the old files",
) )
cmd.parser.add_option( cmd.parser.add_option(
"-d", "--dest", action="store", help="set the destination directory" "-d", "--dest", action="store", help="set the destination directory"
@ -209,16 +210,16 @@ class ConvertPlugin(BeetsPlugin):
"--link", "--link",
action="store_true", action="store_true",
dest="link", dest="link",
help="symlink files that do not \ help="symlink files that do not need transcoding.",
need transcoding.",
) )
cmd.parser.add_option( cmd.parser.add_option(
"-H", "-H",
"--hardlink", "--hardlink",
action="store_true", action="store_true",
dest="hardlink", dest="hardlink",
help="hardlink files that do not \ help=(
need transcoding. Overrides --link.", "hardlink files that do not need transcoding. Overrides --link."
),
) )
cmd.parser.add_option( cmd.parser.add_option(
"-m", "-m",

View file

@ -44,11 +44,12 @@ class Amarok(MetaSource):
"amarok_lastplayed": types.DATE, "amarok_lastplayed": types.DATE,
} }
query_xml = '<query version="1.0"> \ query_xml = """
<filters> \ <query version="1.0">
<and><include field="filename" value={} /></and> \ <filters>
</filters> \ <and><include field="filename" value={} /></and>
</query>' </filters>
</query>"""
def __init__(self, config, log): def __init__(self, config, log):
super().__init__(config, log) super().__init__(config, log)

View file

@ -179,8 +179,7 @@ class ParentWorkPlugin(BeetsPlugin):
if not item.mb_workid: if not item.mb_workid:
self._log.info( self._log.info(
"No work for {}, \ "No work for {}, add one at https://musicbrainz.org/recording/{}",
add one at https://musicbrainz.org/recording/{}",
item, item,
item.mb_trackid, item.mb_trackid,
) )

View file

@ -1542,8 +1542,10 @@ class ReplayGainPlugin(BeetsPlugin):
"--threads", "--threads",
dest="threads", dest="threads",
type=int, type=int,
help="change the number of threads, \ help=(
defaults to maximum available processors", "change the number of threads, defaults to maximum available"
" processors"
),
) )
cmd.parser.add_option( cmd.parser.add_option(
"-f", "-f",

View file

@ -93,8 +93,7 @@ class ParentWorkIntegrationTest(PluginTestCase):
item = Item( item = Item(
path="/file", path="/file",
mb_workid="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53", mb_workid="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53",
parentwork_workid_current="e27bda6e-531e-36d3-9cd7-\ parentwork_workid_current="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53",
b8ebc18e8c53",
) )
item.add(self.lib) item.add(self.lib)
@ -109,8 +108,7 @@ class ParentWorkIntegrationTest(PluginTestCase):
path="/file", path="/file",
mb_workid="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53", mb_workid="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53",
mb_parentworkid="XXX", mb_parentworkid="XXX",
parentwork_workid_current="e27bda6e-531e-36d3-9cd7-\ parentwork_workid_current="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53",
b8ebc18e8c53",
parentwork="whatever", parentwork="whatever",
) )
item.add(self.lib) item.add(self.lib)
@ -124,11 +122,9 @@ class ParentWorkIntegrationTest(PluginTestCase):
self.config["parentwork"]["force"] = False self.config["parentwork"]["force"] = False
item = Item( item = Item(
path="/file", path="/file",
mb_workid="e27bda6e-531e-36d3-9cd7-\ mb_workid="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53",
b8ebc18e8c53",
mb_parentworkid="XXX", mb_parentworkid="XXX",
parentwork_workid_current="e27bda6e-531e-36d3-9cd7-\ parentwork_workid_current="e27bda6e-531e-36d3-9cd7-b8ebc18e8c53",
b8ebc18e8c53",
parentwork="whatever", parentwork="whatever",
) )
item.add(self.lib) item.add(self.lib)