mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Reformat the codebase
This commit is contained in:
parent
06a5ecaf80
commit
85a17ee503
96 changed files with 94 additions and 211 deletions
|
|
@ -16,7 +16,6 @@
|
|||
`python -m beets`.
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
from .ui import main
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
music and items' embedded album art.
|
||||
"""
|
||||
|
||||
|
||||
import os
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Facilities for automatically determining files' correct metadata.
|
||||
"""
|
||||
"""Facilities for automatically determining files' correct metadata."""
|
||||
|
||||
from typing import Mapping, Sequence, Union
|
||||
|
||||
from beets import config, logging
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
releases and tracks.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Searches for albums in the MusicBrainz database.
|
||||
"""
|
||||
"""Searches for albums in the MusicBrainz database."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -1224,9 +1224,7 @@ class Database:
|
|||
UNIQUE(entity_id, key) ON CONFLICT REPLACE);
|
||||
CREATE INDEX IF NOT EXISTS {0}_by_entity
|
||||
ON {0} (entity_id);
|
||||
""".format(
|
||||
flex_table
|
||||
)
|
||||
""".format(flex_table)
|
||||
)
|
||||
|
||||
# Querying.
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Representation of type information for DBCore model fields.
|
||||
"""
|
||||
"""Representation of type information for DBCore model fields."""
|
||||
|
||||
import typing
|
||||
from abc import ABC
|
||||
from typing import Any, Generic, List, TypeVar, Union, cast
|
||||
|
|
|
|||
|
|
@ -627,8 +627,7 @@ class ImportTask(BaseImportTask):
|
|||
self.save_progress()
|
||||
if session.config["incremental"] and not (
|
||||
# Should we skip recording to incremental list?
|
||||
self.skip
|
||||
and session.config["incremental_skip_later"]
|
||||
self.skip and session.config["incremental_skip_later"]
|
||||
):
|
||||
self.save_history()
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ use {}-style formatting and can interpolate keywords arguments to the logging
|
|||
calls (`debug`, `info`, etc).
|
||||
"""
|
||||
|
||||
|
||||
import logging
|
||||
import threading
|
||||
from copy import copy
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Support for beets plugins."""
|
||||
|
||||
|
||||
import abc
|
||||
import inspect
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ interface. To invoke the CLI, just call beets.ui.main(). The actual
|
|||
CLI commands are implemented in the ui.commands module.
|
||||
"""
|
||||
|
||||
|
||||
import errno
|
||||
import optparse
|
||||
import os.path
|
||||
|
|
@ -318,7 +317,7 @@ def input_options(
|
|||
|
||||
# Wrap the query text.
|
||||
# Start prompt with U+279C: Heavy Round-Tipped Rightwards Arrow
|
||||
prompt = colorize("action", "\u279C ")
|
||||
prompt = colorize("action", "\u279c ")
|
||||
line_length = 0
|
||||
for i, (part, length) in enumerate(
|
||||
zip(prompt_parts, prompt_part_lengths)
|
||||
|
|
@ -387,7 +386,7 @@ def input_yn(prompt, require=False):
|
|||
"yes" unless `require` is `True`, in which case there is no default.
|
||||
"""
|
||||
# Start prompt with U+279C: Heavy Round-Tipped Rightwards Arrow
|
||||
yesno = colorize("action", "\u279C ") + colorize(
|
||||
yesno = colorize("action", "\u279c ") + colorize(
|
||||
"action_description", "Enter Y or N:"
|
||||
)
|
||||
sel = input_options(("y", "n"), require, prompt, yesno)
|
||||
|
|
@ -1497,9 +1496,7 @@ class SubcommandsOptionParser(CommonOptionsParser):
|
|||
"""
|
||||
# A more helpful default usage.
|
||||
if "usage" not in kwargs:
|
||||
kwargs[
|
||||
"usage"
|
||||
] = """
|
||||
kwargs["usage"] = """
|
||||
%prog COMMAND [ARGS...]
|
||||
%prog help COMMAND"""
|
||||
kwargs["add_help_option"] = False
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
interface.
|
||||
"""
|
||||
|
||||
|
||||
import os
|
||||
import re
|
||||
from collections import Counter
|
||||
|
|
@ -1317,8 +1316,7 @@ def import_files(lib, paths, query):
|
|||
loghandler = logging.FileHandler(logpath, encoding="utf-8")
|
||||
except OSError:
|
||||
raise ui.UserError(
|
||||
"could not open log file for writing: "
|
||||
"{}".format(displayable_path(logpath))
|
||||
f"Could not open log file for writing: {displayable_path(logpath)}"
|
||||
)
|
||||
else:
|
||||
loghandler = None
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ This is sort of like a tiny, horrible degeneration of a real templating
|
|||
engine like Jinja2 or Mustache.
|
||||
"""
|
||||
|
||||
|
||||
import ast
|
||||
import dis
|
||||
import functools
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ To do so, pass an iterable of coroutines to the Pipeline constructor
|
|||
in place of any single coroutine.
|
||||
"""
|
||||
|
||||
|
||||
import queue
|
||||
import sys
|
||||
from threading import Lock, Thread
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""A namespace package for beets plugins."""
|
||||
|
||||
|
||||
# Make this a namespace package.
|
||||
from pkgutil import extend_path
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Calculate acoustic information and submit to AcousticBrainz.
|
||||
"""
|
||||
|
||||
"""Calculate acoustic information and submit to AcousticBrainz."""
|
||||
|
||||
import errno
|
||||
import hashlib
|
||||
|
|
@ -187,9 +185,9 @@ only files which would be processed",
|
|||
with open(filename) as tmp_file:
|
||||
analysis = json.load(tmp_file)
|
||||
# Add the hash to the output.
|
||||
analysis["metadata"]["version"][
|
||||
"essentia_build_sha"
|
||||
] = self.extractor_sha
|
||||
analysis["metadata"]["version"]["essentia_build_sha"] = (
|
||||
self.extractor_sha
|
||||
)
|
||||
return analysis
|
||||
finally:
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Fetch various AcousticBrainz metadata using MBID.
|
||||
"""
|
||||
"""Fetch various AcousticBrainz metadata using MBID."""
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Adds an album template field for formatted album types."""
|
||||
|
||||
|
||||
from beets.autotag.mb import VARIOUS_ARTISTS_ID
|
||||
from beets.library import Album
|
||||
from beets.plugins import BeetsPlugin
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""An AURA server using Flask."""
|
||||
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Use command-line tools to check for audio file corruption.
|
||||
"""
|
||||
|
||||
"""Use command-line tools to check for audio file corruption."""
|
||||
|
||||
import errno
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
"""Provides a bare-ASCII matching query."""
|
||||
|
||||
|
||||
from unidecode import unidecode
|
||||
|
||||
from beets import ui
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Adds Beatport release and track search support to the autotagger
|
||||
"""
|
||||
"""Adds Beatport release and track search support to the autotagger"""
|
||||
|
||||
import json
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Some simple performance benchmarks for beets.
|
||||
"""
|
||||
|
||||
"""Some simple performance benchmarks for beets."""
|
||||
|
||||
import cProfile
|
||||
import timeit
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ Beets library. Attempts to implement a compatible protocol to allow
|
|||
use of the wide range of MPD clients.
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import math
|
||||
import random
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
music player.
|
||||
"""
|
||||
|
||||
|
||||
import _thread
|
||||
import copy
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Determine BPM by pressing a key to the rhythm."""
|
||||
|
||||
|
||||
import time
|
||||
|
||||
from beets import ui
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Update library's tags using Beatport.
|
||||
"""
|
||||
"""Update library's tags using Beatport."""
|
||||
|
||||
from beets import autotag, library, ui, util
|
||||
from beets.plugins import BeetsPlugin, apply_item_changes
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Provides the %bucket{} function for path formatting.
|
||||
"""
|
||||
|
||||
"""Provides the %bucket{} function for path formatting."""
|
||||
|
||||
import re
|
||||
import string
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Converts tracks or albums to external directory
|
||||
"""
|
||||
"""Converts tracks or albums to external directory"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import shlex
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Adds Deezer release and track search support to the autotagger
|
||||
"""
|
||||
"""Adds Deezer release and track search support to the autotagger"""
|
||||
|
||||
import collections
|
||||
import time
|
||||
|
|
@ -112,8 +111,8 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin):
|
|||
day = None
|
||||
else:
|
||||
raise ui.UserError(
|
||||
"Invalid `release_date` returned "
|
||||
"by {} API: '{}'".format(self.data_source, release_date)
|
||||
f"Invalid `release_date` returned by {self.data_source} API: "
|
||||
f"{release_date!r}"
|
||||
)
|
||||
tracks_obj = self.fetch_data(self.album_url + deezer_id + "/tracks")
|
||||
if tracks_obj is None:
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""List duplicate tracks or albums.
|
||||
"""
|
||||
"""List duplicate tracks or albums."""
|
||||
|
||||
import os
|
||||
import shlex
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Open metadata information in a text editor to let the user edit it.
|
||||
"""
|
||||
"""Open metadata information in a text editor to let the user edit it."""
|
||||
|
||||
import codecs
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""Updates the Emby Library whenever the beets library is changed.
|
||||
|
||||
emby:
|
||||
emby:
|
||||
host: localhost
|
||||
port: 8096
|
||||
username: user
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Exports data from beets
|
||||
"""
|
||||
|
||||
"""Exports data from beets"""
|
||||
|
||||
import codecs
|
||||
import csv
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Fetches album art.
|
||||
"""
|
||||
"""Fetches album art."""
|
||||
|
||||
import os
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Filter imported files using a regular expression.
|
||||
"""
|
||||
|
||||
"""Filter imported files using a regular expression."""
|
||||
|
||||
import re
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ by default but can be added via the `-e` / `--extravalues` flag. For example:
|
|||
`beet fish -e genre -e albumartist`
|
||||
"""
|
||||
|
||||
|
||||
import os
|
||||
from operator import attrgetter
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Creates freedesktop.org-compliant .directory files on an album level.
|
||||
"""
|
||||
|
||||
"""Creates freedesktop.org-compliant .directory files on an album level."""
|
||||
|
||||
from beets import ui
|
||||
from beets.plugins import BeetsPlugin
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Moves "featured" artists to the title from the artist field.
|
||||
"""
|
||||
"""Moves "featured" artists to the title from the artist field."""
|
||||
|
||||
import re
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Provides a fuzzy matching query.
|
||||
"""
|
||||
|
||||
"""Provides a fuzzy matching query."""
|
||||
|
||||
import difflib
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
music player. Also allow printing the new file locations to stdout in case
|
||||
one wants to manually add music to a player by its path.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Shows file metadata.
|
||||
"""
|
||||
|
||||
"""Shows file metadata."""
|
||||
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Allows inline path template customization code in the config file.
|
||||
"""
|
||||
"""Allows inline path template customization code in the config file."""
|
||||
|
||||
import itertools
|
||||
import traceback
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Adds support for ipfs. Requires go-ipfs and a running ipfs daemon
|
||||
"""
|
||||
|
||||
"""Adds support for ipfs. Requires go-ipfs and a running ipfs daemon"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Uses the `KeyFinder` program to add the `initial_key` field.
|
||||
"""
|
||||
|
||||
"""Uses the `KeyFinder` program to add the `initial_key` field."""
|
||||
|
||||
import os.path
|
||||
import subprocess
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ and has been edited to remove some questionable entries.
|
|||
The scraper script used is available here:
|
||||
https://gist.github.com/1241307
|
||||
"""
|
||||
|
||||
import codecs
|
||||
import os
|
||||
import traceback
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Load SQLite extensions.
|
||||
"""
|
||||
|
||||
"""Load SQLite extensions."""
|
||||
|
||||
import sqlite3
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Fetches, embeds, and displays lyrics.
|
||||
"""
|
||||
|
||||
"""Fetches, embeds, and displays lyrics."""
|
||||
|
||||
import difflib
|
||||
import errno
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Update library's tags using MusicBrainz.
|
||||
"""
|
||||
"""Update library's tags using MusicBrainz."""
|
||||
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Synchronize information from music player libraries
|
||||
"""
|
||||
|
||||
"""Synchronize information from music player libraries"""
|
||||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from importlib import import_module
|
||||
|
|
@ -126,8 +124,7 @@ class MetaSyncPlugin(BeetsPlugin):
|
|||
meta_source_instances[player] = cls(self.config, self._log)
|
||||
except (ImportError, ConfigValueError) as e:
|
||||
self._log.error(
|
||||
"Failed to instantiate metadata source "
|
||||
"'{}': {}".format(player, e)
|
||||
f"Failed to instantiate metadata source {player!r}: {e}"
|
||||
)
|
||||
|
||||
# Avoid needlessly iterating over items
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Synchronize information from amarok's library via dbus
|
||||
"""
|
||||
|
||||
"""Synchronize information from amarok's library via dbus"""
|
||||
|
||||
from datetime import datetime
|
||||
from os.path import basename
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Synchronize information from iTunes's library
|
||||
"""
|
||||
|
||||
"""Synchronize information from iTunes's library"""
|
||||
|
||||
import os
|
||||
import plistlib
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""List missing tracks.
|
||||
"""
|
||||
"""List missing tracks."""
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
and work composition date
|
||||
"""
|
||||
|
||||
|
||||
import musicbrainzngs
|
||||
|
||||
from beets import ui
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Send the results of a query to the configured music player as a playlist.
|
||||
"""
|
||||
"""Send the results of a query to the configured music player as a playlist."""
|
||||
|
||||
import shlex
|
||||
import subprocess
|
||||
|
|
@ -197,7 +196,7 @@ class PlayPlugin(BeetsPlugin):
|
|||
filename = get_temp_filename(__name__, suffix=".m3u")
|
||||
with open(filename, "wb") as m3u:
|
||||
if utf8_bom:
|
||||
m3u.write(b"\xEF\xBB\xBF")
|
||||
m3u.write(b"\xef\xbb\xbf")
|
||||
|
||||
for item in paths_list:
|
||||
m3u.write(item + b"\n")
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Get a random song or album from the library.
|
||||
"""
|
||||
"""Get a random song or album from the library."""
|
||||
|
||||
from beets.plugins import BeetsPlugin
|
||||
from beets.random import random_objs
|
||||
|
|
|
|||
|
|
@ -334,9 +334,7 @@ class FfmpegBackend(Backend):
|
|||
task.target_level,
|
||||
task.peak_method,
|
||||
count_blocks=False,
|
||||
)[
|
||||
0
|
||||
] # take only the gain, discarding number of gating blocks
|
||||
)[0] # take only the gain, discarding number of gating blocks
|
||||
for item in task.items
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
automatically whenever tags are written.
|
||||
"""
|
||||
|
||||
|
||||
import mediafile
|
||||
import mutagen
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Generates smart playlists based on beets queries.
|
||||
"""
|
||||
|
||||
"""Generates smart playlists based on beets queries."""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Moves patterns in path formats (suitable for moving articles)."""
|
||||
|
||||
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ This plugin is POSIX-only.
|
|||
Spec: standards.freedesktop.org/thumbnail-spec/latest/index.html
|
||||
"""
|
||||
|
||||
|
||||
import ctypes
|
||||
import ctypes.util
|
||||
import os
|
||||
|
|
@ -280,8 +279,7 @@ class GioURI(URIGetter):
|
|||
if not uri_ptr:
|
||||
self.libgio.g_free(uri_ptr)
|
||||
raise RuntimeError(
|
||||
"No URI received from the gfile pointer for "
|
||||
"{}".format(displayable_path(path))
|
||||
f"No URI received from the gfile pointer for {displayable_path(path)}"
|
||||
)
|
||||
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
""" Clears tag fields in media files."""
|
||||
|
||||
"""Clears tag fields in media files."""
|
||||
|
||||
import re
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""A utility script for automating the beets release process.
|
||||
"""
|
||||
"""A utility script for automating the beets release process."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Tests for the 'acousticbrainz' plugin.
|
||||
"""
|
||||
|
||||
"""Tests for the 'acousticbrainz' plugin."""
|
||||
|
||||
import json
|
||||
import os.path
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test the advancedrewrite plugin for various configurations.
|
||||
"""
|
||||
|
||||
"""Test the advancedrewrite plugin for various configurations."""
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the 'albumtypes' plugin."""
|
||||
|
||||
|
||||
from typing import Sequence, Tuple
|
||||
|
||||
from beets.autotag.mb import VARIOUS_ARTISTS_ID
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the album art fetchers."""
|
||||
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from unittest.mock import patch
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
"""Tests for the 'bareasc' plugin."""
|
||||
|
||||
|
||||
from beets import logging
|
||||
from beets.test.helper import PluginTestCase, capture_stdout
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the 'bucket' plugin."""
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
from beets import config, ui
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test the beets.export utilities associated with the export plugin.
|
||||
"""
|
||||
|
||||
"""Test the beets.export utilities associated with the export plugin."""
|
||||
|
||||
import json
|
||||
import re # used to test csv format
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Tests for the `filefilter` plugin.
|
||||
"""
|
||||
"""Tests for the `filefilter` plugin."""
|
||||
|
||||
from beets.test.helper import ImportTestCase, PluginMixin
|
||||
from beets.util import bytestring_path
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the 'ftintitle' plugin."""
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
"""Tests for the 'limit' plugin."""
|
||||
|
||||
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the 'lyrics' plugin."""
|
||||
|
||||
|
||||
import itertools
|
||||
import os
|
||||
import re
|
||||
|
|
@ -509,14 +508,14 @@ class GeniusFetchTest(GeniusBaseTest):
|
|||
{
|
||||
"result": {
|
||||
"primary_artist": {
|
||||
"name": "\u200Bblackbear",
|
||||
"name": "\u200bblackbear",
|
||||
},
|
||||
"url": "blackbear_url",
|
||||
}
|
||||
},
|
||||
{
|
||||
"result": {
|
||||
"primary_artist": {"name": "El\u002Dp"},
|
||||
"primary_artist": {"name": "El\u002dp"},
|
||||
"url": "El-p_url",
|
||||
}
|
||||
},
|
||||
|
|
@ -786,10 +785,10 @@ class SlugTests(unittest.TestCase):
|
|||
assert lyrics.slug(text) == "cafe-au-lait-boisson"
|
||||
text = "Multiple spaces -- and symbols! -- merged"
|
||||
assert lyrics.slug(text) == "multiple-spaces-and-symbols-merged"
|
||||
text = "\u200Bno-width-space"
|
||||
text = "\u200bno-width-space"
|
||||
assert lyrics.slug(text) == "no-width-space"
|
||||
|
||||
# variations of dashes should get standardized
|
||||
dashes = ["\u200D", "\u2010"]
|
||||
dashes = ["\u200d", "\u2010"]
|
||||
for dash1, dash2 in itertools.combinations(dashes, 2):
|
||||
assert lyrics.slug(dash1) == lyrics.slug(dash2)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the 'parentwork' plugin."""
|
||||
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"""Tests for the 'permissions' plugin.
|
||||
"""
|
||||
"""Tests for the 'permissions' plugin."""
|
||||
|
||||
import os
|
||||
import platform
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the play plugin"""
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Tests the facility that lets plugins add custom field to MediaFile.
|
||||
"""
|
||||
"""Tests the facility that lets plugins add custom field to MediaFile."""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test the beets.random utilities associated with the random plugin.
|
||||
"""
|
||||
|
||||
"""Test the beets.random utilities associated with the random plugin."""
|
||||
|
||||
import math
|
||||
import unittest
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for image resizing based on filesize."""
|
||||
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Tests for autotagging functionality.
|
||||
"""
|
||||
"""Tests for autotagging functionality."""
|
||||
|
||||
import re
|
||||
import unittest
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test for dbcore's date-based queries.
|
||||
"""
|
||||
"""Test for dbcore's date-based queries."""
|
||||
|
||||
import time
|
||||
import unittest
|
||||
|
|
|
|||
|
|
@ -239,9 +239,7 @@ class TransactionTest(unittest.TestCase):
|
|||
old_rev = self.db.revision
|
||||
with self.db.transaction() as tx:
|
||||
tx.mutate(
|
||||
"INSERT INTO {} "
|
||||
"(field_one) "
|
||||
"VALUES (?);".format(ModelFixture1._table),
|
||||
f"INSERT INTO {ModelFixture1._table} (field_one) VALUES (?);",
|
||||
(111,),
|
||||
)
|
||||
assert self.db.revision > old_rev
|
||||
|
|
@ -517,9 +515,7 @@ class QueryParseTest(unittest.TestCase):
|
|||
part,
|
||||
{"year": dbcore.query.NumericQuery},
|
||||
{":": dbcore.query.RegexpQuery},
|
||||
)[
|
||||
:-1
|
||||
] # remove the negate flag
|
||||
)[:-1] # remove the negate flag
|
||||
|
||||
def test_one_basic_term(self):
|
||||
q = "test"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the 'hidden' utility."""
|
||||
|
||||
|
||||
import ctypes
|
||||
import errno
|
||||
import subprocess
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
"""Testsuite for the M3UFile class."""
|
||||
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
from os import path
|
||||
|
|
|
|||
|
|
@ -69,12 +69,12 @@ class MetaSyncTest(PluginTestCase):
|
|||
items[1].album = "An Awesome Wave"
|
||||
|
||||
if _is_windows():
|
||||
items[0].path = (
|
||||
"G:\\Music\\Alt-J\\An Awesome Wave\\03 Tessellate.mp3"
|
||||
)
|
||||
items[1].path = (
|
||||
"G:\\Music\\Alt-J\\An Awesome Wave\\04 Breezeblocks.mp3"
|
||||
)
|
||||
items[
|
||||
0
|
||||
].path = "G:\\Music\\Alt-J\\An Awesome Wave\\03 Tessellate.mp3"
|
||||
items[
|
||||
1
|
||||
].path = "G:\\Music\\Alt-J\\An Awesome Wave\\04 Breezeblocks.mp3"
|
||||
else:
|
||||
items[0].path = "/Music/Alt-J/An Awesome Wave/03 Tessellate.mp3"
|
||||
items[1].path = "/Music/Alt-J/An Awesome Wave/04 Breezeblocks.mp3"
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test the "pipeline.py" restricted parallel programming library.
|
||||
"""
|
||||
"""Test the "pipeline.py" restricted parallel programming library."""
|
||||
|
||||
import unittest
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,6 @@ class ListenersTest(PluginLoaderTestCase):
|
|||
|
||||
@patch("beets.plugins.find_plugins")
|
||||
def test_listener_params(self, mock_find_plugins):
|
||||
|
||||
class DummyPlugin(plugins.BeetsPlugin):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Various tests for querying the library database.
|
||||
"""
|
||||
"""Various tests for querying the library database."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Various tests for querying the library database.
|
||||
"""
|
||||
|
||||
"""Various tests for querying the library database."""
|
||||
|
||||
import beets.library
|
||||
from beets import config, dbcore
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Tests for template engine.
|
||||
"""
|
||||
"""Tests for template engine."""
|
||||
|
||||
import unittest
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Tests for the command-line interface.
|
||||
"""
|
||||
"""Tests for the command-line interface."""
|
||||
|
||||
import os
|
||||
import platform
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test module for file ui/commands.py
|
||||
"""
|
||||
|
||||
"""Test module for file ui/commands.py"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Test module for file ui/__init__.py
|
||||
"""
|
||||
"""Test module for file ui/__init__.py"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@
|
|||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
"""Tests for base utils from the beets.util package.
|
||||
"""
|
||||
"""Tests for base utils from the beets.util package."""
|
||||
|
||||
import os
|
||||
import platform
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the virtual filesystem builder.."""
|
||||
|
||||
|
||||
from beets import vfs
|
||||
from beets.test import _common
|
||||
from beets.test.helper import BeetsTestCase
|
||||
|
|
|
|||
Loading…
Reference in a new issue