diff --git a/beets/importer.py b/beets/importer.py index 561cedd2c..14478b43d 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -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`. diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 900cb9305..ba058148d 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -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) diff --git a/beetsplug/acousticbrainz.py b/beetsplug/acousticbrainz.py index 040463375..0cfd6e318 100644 --- a/beetsplug/acousticbrainz.py +++ b/beetsplug/acousticbrainz.py @@ -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 diff --git a/beetsplug/bpd/__init__.py b/beetsplug/bpd/__init__.py index 07198b1b4..8c02d3d44 100644 --- a/beetsplug/bpd/__init__.py +++ b/beetsplug/bpd/__init__.py @@ -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 diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index f2c1e5a7a..c99c7081f 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -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): diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index 78f146a82..c228f74b3 100644 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -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): diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 30fbabc06..2cbacc92f 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -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'. diff --git a/test/test_convert.py b/test/test_convert.py index cd32e34b1..8786be400 100644 --- a/test/test_convert.py +++ b/test/test_convert.py @@ -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') diff --git a/test/test_importer.py b/test/test_importer.py index 60c0b793f..2bd95315f 100644 --- a/test/test_importer.py +++ b/test/test_importer.py @@ -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): diff --git a/test/test_lyrics.py b/test/test_lyrics.py index e3e3be96f..f8dd0b369 100644 --- a/test/test_lyrics.py +++ b/test/test_lyrics.py @@ -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)]