-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.py
executable file
·40 lines (29 loc) · 1.04 KB
/
configuration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import datetime
import logging
import sys
import threading
PYTHON3_PATH = "/usr/bin/python3"
REGAINER_PATH = "/usr/bin/regainer.py"
REGAINER_ARGS = ["--preserve-album-gain"]
ALLOWED_EXTENSIONS = [".flac"]
MODIFICATION_DATETIME_DELTA = datetime.timedelta(days=5)
MODIFICATION_DATETIME_THRESHOLD = datetime.datetime.now() - MODIFICATION_DATETIME_DELTA
MAX_CONCURRENCY = 4
SEMAPHORE = threading.Semaphore(value=MAX_CONCURRENCY)
LOGGER_NAME = "replay-gain-calculator"
LOG_FORMAT = "[%(asctime)-15s: %(levelname)s/%(funcName)s] %(message)s"
LOG_FORMATTER = logging.Formatter(LOG_FORMAT)
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.setLevel(logging.DEBUG)
STDOUT_HANDLER = logging.StreamHandler(sys.stdout)
STDOUT_HANDLER.setFormatter(LOG_FORMATTER)
LOGGER.addHandler(STDOUT_HANDLER)
STDERR_HANDLER = logging.StreamHandler(sys.stderr)
STDERR_HANDLER.setFormatter(LOG_FORMATTER)
STDERR_HANDLER.setLevel(logging.ERROR)
LOGGER.addHandler(STDERR_HANDLER)
EXCLUDE_PATH_PATTERNS = []
try:
from local_configuration import *
except ModuleNotFoundError:
pass