Adapt to pycodestyle changes

This commit is contained in:
Adrian Sampson 2022-07-30 19:54:11 -04:00
parent 3a8fdcd633
commit c5e68f5643
No known key found for this signature in database
GPG key ID: BDB93AB409CC8705
10 changed files with 25 additions and 21 deletions

View file

@ -726,8 +726,8 @@ class ImportTask(BaseImportTask):
item.update(changes)
def manipulate_files(self, operation=None, write=False, session=None):
""" Copy, move, link, hardlink or reflink (depending on `operation`) the files
as well as write metadata.
""" Copy, move, link, hardlink or reflink (depending on `operation`)
the files as well as write metadata.
`operation` should be an instance of `util.MoveOperation`.

View file

@ -581,7 +581,7 @@ def _colordiff(a, b, highlight='text_highlight',
a_out.append(colorize(color, a[a_start:a_end]))
b_out.append(colorize(color, b[b_start:b_end]))
else:
assert(False)
assert False
return ''.join(a_out), ''.join(b_out)

View file

@ -233,9 +233,10 @@ class AcousticPlugin(plugins.BeetsPlugin):
item.try_write()
def _map_data_to_scheme(self, data, scheme):
"""Given `data` as a structure of nested dictionaries, and `scheme` as a
structure of nested dictionaries , `yield` tuples `(attr, val)` where
`attr` and `val` are corresponding leaf nodes in `scheme` and `data`.
"""Given `data` as a structure of nested dictionaries, and
`scheme` as a structure of nested dictionaries , `yield` tuples
`(attr, val)` where `attr` and `val` are corresponding leaf
nodes in `scheme` and `data`.
As its name indicates, `scheme` defines how the data is structured,
so this function tries to find leaf nodes in `data` that correspond

View file

@ -510,7 +510,7 @@ class BaseServer:
"""Remove the song at index from the playlist."""
index = cast_arg(int, index)
try:
del(self.playlist[index])
del self.playlist[index]
except IndexError:
raise ArgumentIndexError()
self.playlist_version += 1

View file

@ -362,8 +362,9 @@ class CoverArtArchive(RemoteArtSource):
GROUP_URL = 'https://coverartarchive.org/release-group/{mbid}'
def get(self, album, plugin, paths):
"""Return the Cover Art Archive and Cover Art Archive release group URLs
using album MusicBrainz release ID and release group ID.
"""Return the Cover Art Archive and Cover Art Archive release
group URLs using album MusicBrainz release ID and release group
ID.
"""
def get_image_urls(url, size_suffix=None):

View file

@ -904,14 +904,14 @@ class GStreamerBackend(Backend):
def _on_pad_added(self, decbin, pad):
sink_pad = self._conv.get_compatible_pad(pad, None)
assert(sink_pad is not None)
assert sink_pad is not None
pad.link(sink_pad)
def _on_pad_removed(self, decbin, pad):
# Called when the decodebin element is disconnected from the
# rest of the pipeline while switching input files
peer = pad.get_peer()
assert(peer is None)
assert peer is None
class AudioToolsBackend(Backend):

View file

@ -374,8 +374,8 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
return unidecode.unidecode(query)
def _search_api(self, query_type, filters=None, keywords=''):
"""Query the Spotify Search API for the specified ``keywords``, applying
the provided ``filters``.
"""Query the Spotify Search API for the specified ``keywords``,
applying the provided ``filters``.
:param query_type: Item type to search across. Valid types are:
'album', 'artist', 'playlist', and 'track'.

View file

@ -48,7 +48,8 @@ class TestHelper(helper.TestHelper):
shell_quote(stub), tag)
def assertFileTag(self, path, tag): # noqa
"""Assert that the path is a file and the files content ends with `tag`.
"""Assert that the path is a file and the files content ends
with `tag`.
"""
display_tag = tag
tag = tag.encode('utf-8')

View file

@ -228,14 +228,14 @@ class ImportHelper(TestHelper):
)
def assert_file_in_lib(self, *segments):
"""Join the ``segments`` and assert that this path exists in the library
directory
"""Join the ``segments`` and assert that this path exists in the
library directory.
"""
self.assertExists(os.path.join(self.libdir, *segments))
def assert_file_not_in_lib(self, *segments):
"""Join the ``segments`` and assert that this path exists in the library
directory
"""Join the ``segments`` and assert that this path does not
exist in the library directory.
"""
self.assertNotExists(os.path.join(self.libdir, *segments))
@ -462,8 +462,8 @@ class ImportPasswordRarTest(ImportZipTest):
class ImportSingletonTest(_common.TestCase, ImportHelper):
"""Test ``APPLY`` and ``ASIS`` choices for an import session with singletons
config set to True.
"""Test ``APPLY`` and ``ASIS`` choices for an import session with
singletons config set to True.
"""
def setUp(self):

View file

@ -336,7 +336,8 @@ class LyricsPluginSourcesTest(LyricsGoogleBaseTest, LyricsAssertions):
os.environ.get('INTEGRATION_TEST', '0') == '1',
'integration testing not enabled')
def test_backend_sources_ok(self):
"""Test default backends with songs known to exist in respective databases.
"""Test default backends with songs known to exist in respective
databases.
"""
# Don't test any sources marked as skipped.
sources = [s for s in self.DEFAULT_SOURCES if not s.get("skip", False)]