diff options
author | Wolfgang Müller | 2024-09-16 19:58:21 +0200 |
---|---|---|
committer | Wolfgang Müller | 2024-09-16 20:48:58 +0200 |
commit | bf3cece9b9de955c1df15bc1335dd96cd36a48c3 (patch) | |
tree | 10e24e79c954fa6f46cfd7f3c2bb780698d346f7 /beetsplug/extras.py | |
parent | 7d23c72319812790cd8d44d60d7e1acf653bb74e (diff) | |
download | beets-oriole-bf3cece9b9de955c1df15bc1335dd96cd36a48c3.tar.gz |
lint: Format code with Black
Diffstat (limited to '')
-rw-r--r-- | beetsplug/extras.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/beetsplug/extras.py b/beetsplug/extras.py index 8227064..ea394b6 100644 --- a/beetsplug/extras.py +++ b/beetsplug/extras.py @@ -1,22 +1,24 @@ import os import shutil + import beets.plugins + class ExtrasPlugin(beets.plugins.BeetsPlugin): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.register_listener('item_moved', self.on_item_moved) - self.register_listener('item_copied', self.on_item_copied) + self.register_listener("item_moved", self.on_item_moved) + self.register_listener("item_copied", self.on_item_copied) def on_item_moved(self, item, source, destination): - for (sourcepath, destpath) in self.gather(source, destination): + for sourcepath, destpath in self.gather(source, destination): # need to decode to str here as shutil.move (still) breaks on bytes # arguments because of _destinsrc using str.endswith shutil.move(sourcepath.decode(), destpath.decode()) def on_item_copied(self, item, source, destination): - for (sourcepath, destpath) in self.gather(source, destination): + for sourcepath, destpath in self.gather(source, destination): if os.path.isdir(sourcepath): shutil.copytree(sourcepath, destpath) else: @@ -30,7 +32,7 @@ class ExtrasPlugin(beets.plugins.BeetsPlugin): if sourcedir == destdir: return [] - paths = [beets.util.bytestring_path(p) for p in self.config['paths'].get()] + paths = [beets.util.bytestring_path(p) for p in self.config["paths"].get()] for path in paths: sourcepath = os.path.join(sourcedir, path) |