mirror of
https://github.com/fergalmoran/picard.git
synced 2026-04-05 03:55:14 +00:00
isort: Consistently use two blank lines after import
This commit is contained in:
@@ -24,3 +24,4 @@ skip_glob=**/picard/ui/ui_*.py
|
||||
skip=./tagger.py,picard/const/attributes.py,picard/const/countries.py,picard/resources.py,scripts/picard.in,picard/const/__init__.py,picard/formats/__init__.py,picard/coverart/providers/__init__.py
|
||||
not_skip=__init__.py
|
||||
use_parentheses=1
|
||||
lines_after_imports=2
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
import re
|
||||
|
||||
|
||||
PICARD_ORG_NAME = "MusicBrainz"
|
||||
PICARD_APP_NAME = "Picard"
|
||||
PICARD_VERSION = (2, 2, 0, 'dev', 1)
|
||||
|
||||
@@ -26,6 +26,7 @@ from picard import (
|
||||
log,
|
||||
)
|
||||
|
||||
|
||||
user_collections = {}
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ from picard.const import (
|
||||
DEFAULT_NUMBERED_SCRIPT_NAME,
|
||||
)
|
||||
|
||||
|
||||
# TO ADD AN UPGRADE HOOK:
|
||||
# ----------------------
|
||||
# add a function here, named after the version you want upgrade to
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
IS_WIN = sys.platform == 'win32'
|
||||
IS_LINUX = sys.platform == 'linux'
|
||||
IS_MACOS = sys.platform == 'darwin'
|
||||
|
||||
@@ -45,6 +45,7 @@ from picard.util import (
|
||||
)
|
||||
from picard.util.scripttofilename import script_to_filename
|
||||
|
||||
|
||||
_datafiles = dict()
|
||||
_datafile_mutex = QMutex(QMutex.Recursive)
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ from picard.util import webbrowser2
|
||||
from picard.ui.ui_provider_options_caa import Ui_CaaOptions
|
||||
from picard.ui.util import StandardButton
|
||||
|
||||
|
||||
CaaSizeItem = namedtuple('CaaSizeItem', ['thumbnail', 'label'])
|
||||
|
||||
_CAA_THUMBNAIL_SIZE_MAP = OrderedDict([
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
from picard.const import MB_ATTRIBUTES
|
||||
from picard.i18n import gettext_attr
|
||||
|
||||
|
||||
# list of types from http://musicbrainz.org/doc/Cover_Art/Types
|
||||
# order of declaration is preserved in selection box
|
||||
CAA_TYPES = []
|
||||
|
||||
@@ -45,6 +45,7 @@ from picard.util import (
|
||||
|
||||
from .mutagenext import tak
|
||||
|
||||
|
||||
INVALID_CHARS = re.compile('[^\x20-\x7e]')
|
||||
BLACKLISTED_KEYS = ['ID3', 'TAG', 'OggS', 'MP+']
|
||||
UNSUPPORTED_TAGS = [
|
||||
|
||||
@@ -44,6 +44,7 @@ from picard.util import (
|
||||
sanitize_date,
|
||||
)
|
||||
|
||||
|
||||
id3.GRP1 = compatid3.GRP1
|
||||
id3.TCMP = compatid3.TCMP
|
||||
id3.TSO2 = compatid3.TSO2
|
||||
|
||||
@@ -25,6 +25,7 @@ from mutagen.id3 import (
|
||||
TextFrame,
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
from mutagen.id3 import GRP1
|
||||
except ImportError:
|
||||
|
||||
@@ -48,6 +48,7 @@ from picard.util import (
|
||||
sanitize_date,
|
||||
)
|
||||
|
||||
|
||||
INVALID_CHARS = re.compile('([^\x20-\x7d]|=)')
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ from picard.const.sys import (
|
||||
IS_WIN,
|
||||
)
|
||||
|
||||
|
||||
builtins.__dict__['N_'] = lambda a: a
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ from threading import Lock
|
||||
|
||||
from PyQt5 import QtCore
|
||||
|
||||
|
||||
_MAX_TAIL_LEN = 10**6
|
||||
|
||||
VERBOSITY_DEFAULT = logging.WARNING
|
||||
|
||||
@@ -28,6 +28,7 @@ from picard.util import (
|
||||
translate_from_sortname,
|
||||
)
|
||||
|
||||
|
||||
_artist_rel_types = {
|
||||
"arranger": "arranger",
|
||||
"audio": "engineer",
|
||||
|
||||
@@ -36,6 +36,7 @@ from picard.util import linear_combination_of_weights
|
||||
from picard.util.imagelist import ImageList
|
||||
from picard.util.tags import PRESERVED_TAGS
|
||||
|
||||
|
||||
MULTI_VALUED_JOINER = '; '
|
||||
|
||||
# lengths difference over this number of milliseconds will give a score of 0.0
|
||||
|
||||
@@ -45,6 +45,7 @@ from picard.const import (
|
||||
)
|
||||
import picard.plugins
|
||||
|
||||
|
||||
_suffixes = [s[0] for s in imp.get_suffixes()]
|
||||
_package_entries = ["__init__.py", "__init__.pyc", "__init__.pyo"]
|
||||
_extension_points = []
|
||||
|
||||
@@ -52,6 +52,7 @@ from picard.util.textencoding import asciipunct
|
||||
|
||||
from picard.ui.item import Item
|
||||
|
||||
|
||||
_TRANSLATE_TAGS = {
|
||||
"hip hop": "Hip-Hop",
|
||||
"synth-pop": "Synthpop",
|
||||
|
||||
@@ -31,6 +31,7 @@ from picard.const.sys import IS_MACOS
|
||||
from picard.formats import supported_formats
|
||||
from picard.util import find_existing_path
|
||||
|
||||
|
||||
_default_current_browser_path = QStandardPaths.writableLocation(QStandardPaths.HomeLocation)
|
||||
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ from picard.ui.util import (
|
||||
find_starting_directory,
|
||||
)
|
||||
|
||||
|
||||
ui_init = ExtensionPoint()
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ from picard.util.tags import display_tag_name
|
||||
|
||||
from picard.ui.edittagdialog import EditTagDialog
|
||||
|
||||
|
||||
COMMON_TAGS = [
|
||||
"title",
|
||||
"artist",
|
||||
|
||||
@@ -30,6 +30,7 @@ from picard.ui.options import (
|
||||
register_options_page,
|
||||
)
|
||||
|
||||
|
||||
if AUTO_DETECT_DRIVES:
|
||||
from picard.ui.ui_options_cdlookup_select import Ui_CDLookupOptionsPage
|
||||
else:
|
||||
|
||||
@@ -39,6 +39,7 @@ from picard.ui.options import (
|
||||
from picard.ui.ui_options_interface import Ui_InterfaceOptionsPage
|
||||
from picard.ui.util import enabledSlot
|
||||
|
||||
|
||||
_default_starting_dir = QStandardPaths.writableLocation(QStandardPaths.HomeLocation)
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ from picard.ui.options import (
|
||||
)
|
||||
from picard.ui.ui_options_plugins import Ui_PluginsOptionsPage
|
||||
|
||||
|
||||
COLUMN_NAME, COLUMN_VERSION, COLUMN_ACTIONS = range(3)
|
||||
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ from picard.ui.options import (
|
||||
)
|
||||
from picard.ui.ui_options_releases import Ui_ReleasesOptionsPage
|
||||
|
||||
|
||||
_DEFAULT_SCORE = 0.5
|
||||
_release_type_scores = [(g, _DEFAULT_SCORE) for g in list(RELEASE_PRIMARY_GROUPS.keys()) + list(RELEASE_SECONDARY_GROUPS.keys())]
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ from picard.ui.options.scripting import TaggerScriptSyntaxHighlighter
|
||||
from picard.ui.ui_options_renaming import Ui_RenamingOptionsPage
|
||||
from picard.ui.util import enabledSlot
|
||||
|
||||
|
||||
_default_music_dir = QStandardPaths.writableLocation(QStandardPaths.MusicLocation)
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ from picard.const.sys import (
|
||||
IS_WIN,
|
||||
)
|
||||
|
||||
|
||||
if IS_WIN:
|
||||
from ctypes import windll
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ It supports i18n through gettext, decimal and binary units.
|
||||
|
||||
import locale
|
||||
|
||||
|
||||
# used to force gettextization
|
||||
_BYTES_STRINGS_I18N = (
|
||||
N_('%s B'),
|
||||
|
||||
@@ -30,6 +30,7 @@ from picard.const.sys import (
|
||||
)
|
||||
from picard.util import uniqify
|
||||
|
||||
|
||||
if IS_WIN:
|
||||
from ctypes import windll
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ from PyQt5 import QtGui
|
||||
|
||||
from picard.const.sys import IS_WIN
|
||||
|
||||
|
||||
if IS_WIN:
|
||||
_search_paths = []
|
||||
else:
|
||||
|
||||
@@ -67,6 +67,7 @@ import unicodedata
|
||||
|
||||
from picard.util import sanitize_filename
|
||||
|
||||
|
||||
######################### LATIN SIMPLIFICATION ###########################
|
||||
# The translation tables for punctuation and latin combined-characters are taken from
|
||||
# http://unicode.org/repos/cldr/trunk/common/transforms/Latin-ASCII.xml
|
||||
|
||||
@@ -33,6 +33,7 @@ from picard import PICARD_FANCY_VERSION_STR
|
||||
from picard.disc import discid_version
|
||||
from picard.util.astrcmp import astrcmp_implementation
|
||||
|
||||
|
||||
_versions = OrderedDict([
|
||||
("version", PICARD_FANCY_VERSION_STR),
|
||||
("python-version", python_version()),
|
||||
|
||||
@@ -23,6 +23,7 @@ import re
|
||||
|
||||
from PyQt5.QtCore import QXmlStreamReader
|
||||
|
||||
|
||||
_node_name_re = re.compile('[^a-zA-Z0-9]')
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ from picard.util import (
|
||||
from picard.util.xml import parse_xml
|
||||
from picard.webservice import ratecontrol
|
||||
|
||||
|
||||
COUNT_REQUESTS_DELAY_MS = 250
|
||||
|
||||
TEMP_ERRORS_RETRIES = 5
|
||||
|
||||
@@ -38,6 +38,7 @@ from picard.webservice import (
|
||||
ratecontrol,
|
||||
)
|
||||
|
||||
|
||||
ratecontrol.set_minimum_delay((ACOUSTID_HOST, ACOUSTID_PORT), 333)
|
||||
ratecontrol.set_minimum_delay((CAA_HOST, CAA_PORT), 0)
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import time
|
||||
|
||||
from picard import log
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Throttling/congestion avoidance
|
||||
# ============================================================================
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import glob
|
||||
import os.path
|
||||
|
||||
|
||||
for filename in glob.glob(os.path.join(os.path.dirname(__file__), "test_*.py")):
|
||||
__import__("test." + os.path.basename(filename)[:-3])
|
||||
|
||||
@@ -13,6 +13,7 @@ import picard.formats
|
||||
from picard.formats import ext_to_format
|
||||
from picard.metadata import Metadata
|
||||
|
||||
|
||||
settings = {
|
||||
'clear_existing_tags': False,
|
||||
'embed_only_one_front_image': False,
|
||||
|
||||
@@ -9,6 +9,7 @@ from .common import (
|
||||
)
|
||||
from .coverart import CommonCoverArtTests
|
||||
|
||||
|
||||
VALID_KEYS = [
|
||||
' valid Key}',
|
||||
'{ $ome tag~}',
|
||||
|
||||
@@ -23,6 +23,7 @@ from .coverart import (
|
||||
file_save_image,
|
||||
)
|
||||
|
||||
|
||||
VALID_KEYS = [
|
||||
' valid Key}',
|
||||
'{ $ome tag}',
|
||||
|
||||
@@ -9,6 +9,7 @@ from picard.mbjson import recording_to_metadata
|
||||
from picard.metadata import Metadata
|
||||
from picard.track import Track
|
||||
|
||||
|
||||
settings = {
|
||||
"standardize_tracks": False,
|
||||
"standardize_artists": False,
|
||||
|
||||
@@ -9,6 +9,7 @@ from test.picardtestcase import PicardTestCase
|
||||
from picard.browser.filelookup import FileLookup
|
||||
from picard.util import webbrowser2
|
||||
|
||||
|
||||
SERVER = 'musicbrainz.org'
|
||||
PORT = 443
|
||||
LOCAL_PORT = "8000"
|
||||
|
||||
@@ -9,6 +9,7 @@ from test.picardtestcase import PicardTestCase
|
||||
from picard import config
|
||||
import picard.formats
|
||||
|
||||
|
||||
settings = {
|
||||
'enabled_plugins': '',
|
||||
'move_files': True,
|
||||
|
||||
@@ -20,6 +20,7 @@ from picard.metadata import Metadata
|
||||
from picard.releasegroup import ReleaseGroup
|
||||
from picard.track import Track
|
||||
|
||||
|
||||
settings = {
|
||||
"standardize_tracks": False,
|
||||
"standardize_artists": False,
|
||||
|
||||
@@ -9,6 +9,7 @@ from picard.metadata import (
|
||||
)
|
||||
from picard.util.tags import PRESERVED_TAGS
|
||||
|
||||
|
||||
settings = {
|
||||
'write_id3v23': False,
|
||||
'id3v23_join_with': '/',
|
||||
|
||||
@@ -10,6 +10,7 @@ from picard import config
|
||||
from picard.i18n import setup_gettext
|
||||
from picard.releasegroup import ReleaseGroup
|
||||
|
||||
|
||||
settings = {
|
||||
"standardize_tracks": False,
|
||||
"standardize_artists": False,
|
||||
|
||||
@@ -7,6 +7,7 @@ from picard.metadata import Metadata
|
||||
from picard.script import register_script_function
|
||||
from picard.util.scripttofilename import script_to_filename
|
||||
|
||||
|
||||
settings = {
|
||||
'ascii_filenames': False,
|
||||
'enabled_plugins': [],
|
||||
|
||||
@@ -3,6 +3,7 @@ from test.picardtestcase import PicardTestCase
|
||||
|
||||
from picard import util
|
||||
|
||||
|
||||
#from picard.util import textencoding
|
||||
|
||||
# Set the value to true below to show the coverage of Latin characters
|
||||
|
||||
@@ -5,6 +5,7 @@ from test.picardtestcase import PicardTestCase
|
||||
|
||||
from picard.util.astrcmp import astrcmp_py
|
||||
|
||||
|
||||
try:
|
||||
from picard.util.astrcmp import astrcmp_c
|
||||
except ImportError:
|
||||
|
||||
@@ -15,6 +15,7 @@ from picard.util import (
|
||||
sort_by_similarity,
|
||||
)
|
||||
|
||||
|
||||
# ensure _() is defined
|
||||
if '_' not in builtins.__dict__:
|
||||
builtins.__dict__['_'] = lambda a: a
|
||||
|
||||
@@ -14,6 +14,7 @@ from picard.webservice import (
|
||||
ratecontrol,
|
||||
)
|
||||
|
||||
|
||||
PROXY_SETTINGS = {
|
||||
"use_proxy": True,
|
||||
"proxy_server_host": '127.0.0.1',
|
||||
|
||||
Reference in New Issue
Block a user