From 1fd22604fb50d8c53e9eb733ddba624e887225b0 Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Sun, 19 Feb 2017 17:33:26 -0600 Subject: [PATCH] Fix linter issues --- beets/importer.py | 4 ++-- docs/reference/config.rst | 2 +- test/test_files.py | 4 ++-- test/test_importer.py | 4 ++-- test/test_mediafile_edge.py | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/beets/importer.py b/beets/importer.py index 275e889f6..bbe152cd4 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -671,8 +671,8 @@ class ImportTask(BaseImportTask): # move in-library files. (Out-of-library files are # copied/moved as usual). old_path = item.path - if (copy or link or hardlink) and self.replaced_items[item] and \ - session.lib.directory in util.ancestry(old_path): + if (copy or link or hardlink) and self.replaced_items[item] \ + and session.lib.directory in util.ancestry(old_path): item.move() # We moved the item, so remove the # now-nonexistent file from old_paths. diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 679b036f6..bf3d89b2e 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -445,7 +445,7 @@ option to preserve the metadata on the linked files. .. _hardlink: hardlink -~~~~ +~~~~~~~~ Either ``yes`` or ``no``, indicating whether to use hard links instead of moving or copying or symlinking files. (It conflicts with the ``move``, diff --git a/test/test_files.py b/test/test_files.py index 38689bbd9..834d3391c 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -148,8 +148,8 @@ class MoveTest(_common.TestCase): s1 = os.stat(self.path) s2 = os.stat(self.dest) self.assertTrue( - (s1[stat.ST_INO], s1[stat.ST_DEV]) == \ - (s2[stat.ST_INO], s2[stat.ST_DEV]) + (s1[stat.ST_INO], s1[stat.ST_DEV]) == + (s2[stat.ST_INO], s2[stat.ST_DEV]) ) @unittest.skipUnless(_common.HAVE_HARDLINK, "need hardlinks") diff --git a/test/test_importer.py b/test/test_importer.py index c372d04da..26dec3de8 100644 --- a/test/test_importer.py +++ b/test/test_importer.py @@ -370,8 +370,8 @@ class NonAutotaggedImportTest(_common.TestCase, ImportHelper): s1 = os.stat(mediafile.path) s2 = os.stat(filename) self.assertTrue( - (s1[stat.ST_INO], s1[stat.ST_DEV]) == \ - (s2[stat.ST_INO], s2[stat.ST_DEV]) + (s1[stat.ST_INO], s1[stat.ST_DEV]) == + (s2[stat.ST_INO], s2[stat.ST_DEV]) ) diff --git a/test/test_mediafile_edge.py b/test/test_mediafile_edge.py index c631cdecf..657ca455d 100644 --- a/test/test_mediafile_edge.py +++ b/test/test_mediafile_edge.py @@ -197,6 +197,7 @@ class SafetyTest(unittest.TestCase, _common.TempDirMixin): finally: os.unlink(fn) + class SideEffectsTest(unittest.TestCase): def setUp(self): self.empty = os.path.join(_common.RSRC, b'empty.mp3')