Add isort pre-commit hook

Sort import statement in python files

See https://github.com/PyCQA/isort
This commit is contained in:
jo 2021-06-03 15:20:39 +02:00
parent b75d9e5c59
commit 01fbd1e8b9
75 changed files with 282 additions and 232 deletions

View file

@ -2,15 +2,16 @@
"""
import logging
import logging.handlers
import sys
import signal
import sys
import traceback
from . import config_file
from functools import partial
from . import config_file
from .message_listener import MessageListener
from .metadata_analyzer import MetadataAnalyzer
from .replaygain_analyzer import ReplayGainAnalyzer
from .status_reporter import StatusReporter
from .message_listener import MessageListener
class AirtimeAnalyzerServer:

View file

@ -1,15 +1,16 @@
""" Analyzes and imports an audio file into the Airtime library.
"""
import logging
import threading
import multiprocessing
from queue import Queue
import configparser
from .metadata_analyzer import MetadataAnalyzer
from .filemover_analyzer import FileMoverAnalyzer
import logging
import multiprocessing
import threading
from queue import Queue
from .cuepoint_analyzer import CuePointAnalyzer
from .replaygain_analyzer import ReplayGainAnalyzer
from .filemover_analyzer import FileMoverAnalyzer
from .metadata_analyzer import MetadataAnalyzer
from .playability_analyzer import *
from .replaygain_analyzer import ReplayGainAnalyzer
class AnalyzerPipeline:

View file

@ -2,10 +2,11 @@
Main CLI entrypoint for the libretime-analyzer app.
"""
import daemon
import argparse
import os
import airtime_analyzer.airtime_analyzer as aa
import daemon
VERSION = "1.0"
LIBRETIME_CONF_DIR = os.getenv("LIBRETIME_CONF_DIR", "/etc/airtime")

View file

@ -1,8 +1,9 @@
import subprocess
import logging
import traceback
import json
import datetime
import json
import logging
import subprocess
import traceback
from .analyzer import Analyzer

View file

@ -1,8 +1,7 @@
import errno
import logging
import os
import time
import shutil
import os, errno
import time
import uuid

View file

@ -1,12 +1,14 @@
import sys
import pika
import json
import time
import select
import signal
import logging
import multiprocessing
import queue
import select
import signal
import sys
import time
import pika
from .analyzer_pipeline import AnalyzerPipeline
from .status_reporter import StatusReporter

View file

@ -1,11 +1,13 @@
import time
import datetime
import mutagen
import magic
import wave
import hashlib
import logging
import os
import hashlib
import time
import wave
import magic
import mutagen
from .analyzer import Analyzer

View file

@ -1,7 +1,8 @@
__author__ = "asantoni"
import subprocess
import logging
import subprocess
from .analyzer import Analyzer

View file

@ -1,7 +1,8 @@
import subprocess
import logging
from .analyzer import Analyzer
import re
import subprocess
from .analyzer import Analyzer
class ReplayGainAnalyzer(Analyzer):

View file

@ -1,14 +1,15 @@
import requests
import collections
import json
import logging
import collections
import pickle
import queue
import threading
import time
import traceback
import pickle
import threading
from urllib.parse import urlparse
import requests
# Disable urllib3 warnings because these can cause a rare deadlock due to Python 2's crappy internal non-reentrant locking
# around POSIX stuff. See SAAS-714. The hasattr() is for compatibility with older versions of requests.
if hasattr(requests, "packages"):

View file

@ -1,6 +1,7 @@
from setuptools import setup
import os
from setuptools import setup
# Change directory since setuptools uses relative paths
os.chdir(os.path.dirname(os.path.realpath(__file__)))

View file

@ -1,5 +1,5 @@
from nose.tools import *
import airtime_analyzer
from nose.tools import *
def setup():

View file

@ -1,11 +1,12 @@
from nose.tools import *
import datetime
import multiprocessing
import os
import shutil
import multiprocessing
from queue import Queue
import datetime
from airtime_analyzer.analyzer_pipeline import AnalyzerPipeline
from airtime_analyzer import config_file
from airtime_analyzer.analyzer_pipeline import AnalyzerPipeline
from nose.tools import *
DEFAULT_AUDIO_FILE = u"tests/test_data/44100Hz-16bit-mono.mp3"
DEFAULT_IMPORT_DEST = u"Test Artist/Test Album/44100Hz-16bit-mono.mp3"

View file

@ -1,5 +1,5 @@
from nose.tools import *
from airtime_analyzer.analyzer import Analyzer
from nose.tools import *
def setup():

View file

@ -1,5 +1,5 @@
from nose.tools import *
from airtime_analyzer.cuepoint_analyzer import CuePointAnalyzer
from nose.tools import *
def check_default_metadata(metadata):

View file

@ -1,11 +1,12 @@
from nose.tools import *
import multiprocessing
import os
import shutil
import multiprocessing
import time
import mock
from pprint import pprint
import mock
from airtime_analyzer.filemover_analyzer import FileMoverAnalyzer
from nose.tools import *
DEFAULT_AUDIO_FILE = u"tests/test_data/44100Hz-16bit-mono.mp3"
DEFAULT_IMPORT_DEST = u"Test Artist/Test Album/44100Hz-16bit-mono.mp3"

View file

@ -1,9 +1,11 @@
from __future__ import print_function
import datetime
import mutagen
import mock
from nose.tools import *
import mutagen
from airtime_analyzer.metadata_analyzer import MetadataAnalyzer
from nose.tools import *
def setup():

View file

@ -1,5 +1,5 @@
from nose.tools import *
from airtime_analyzer.playability_analyzer import *
from nose.tools import *
def check_default_metadata(metadata):

View file

@ -1,6 +1,7 @@
from __future__ import print_function
from nose.tools import *
from airtime_analyzer.replaygain_analyzer import ReplayGainAnalyzer
from nose.tools import *
def check_default_metadata(metadata):