reverted config changes
This commit is contained in:
parent
2da7459595
commit
c66b021ecc
@ -3,7 +3,7 @@ import logging
|
||||
import gc
|
||||
import musicbrainzngs
|
||||
|
||||
from .utils.old_config import read_config
|
||||
from .utils.config import read_config
|
||||
from .utils.shared import MODIFY_GC
|
||||
from . import cli
|
||||
|
||||
|
@ -87,7 +87,7 @@ def cli():
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
from . import cli
|
||||
from .utils.old_config import read_config
|
||||
from .utils.config import read_config
|
||||
from .utils import shared
|
||||
|
||||
if arguments.r:
|
||||
|
5
src/music_kraken/_settings/default.py
Normal file
5
src/music_kraken/_settings/default.py
Normal file
@ -0,0 +1,5 @@
|
||||
from .structure import SettingStructure
|
||||
|
||||
settings: SettingStructure = {
|
||||
"bitrate": 125
|
||||
}
|
4
src/music_kraken/_settings/structure.py
Normal file
4
src/music_kraken/_settings/structure.py
Normal file
@ -0,0 +1,4 @@
|
||||
from typing import TypedDict
|
||||
|
||||
class SettingStructure(TypedDict):
|
||||
bitrate: int
|
@ -5,7 +5,7 @@ import re
|
||||
from .utils import cli_function
|
||||
from .options.first_config import initial_config
|
||||
|
||||
from ..utils.old_config import set_name_to_value, write_config
|
||||
from ..utils.config import set_name_to_value, write_config
|
||||
from ..utils.shared import MUSIC_DIR, NOT_A_GENRE_REGEX, ENABLE_RESULT_HISTORY, HISTORY_LENGTH, HELP_MESSAGE, HASNT_YET_STARTED
|
||||
from ..utils.regex import URL_PATTERN
|
||||
from ..utils.string_processing import fit_to_file_system
|
||||
|
@ -1,6 +1,6 @@
|
||||
from ..utils import cli_function
|
||||
|
||||
from ...utils.old_config import config, write_config
|
||||
from ...utils.config import config, write_config
|
||||
from ...utils import exception
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@ import re
|
||||
|
||||
from ...utils.exception.config import SettingValueError
|
||||
from ...utils.shared import PROXIES_LIST, YOUTUBE_MUSIC_LOGGER, DEBUG
|
||||
from ...utils.old_config import CONNECTION_SECTION, write_config
|
||||
from ...utils.config import CONNECTION_SECTION, write_config
|
||||
from ...utils.functions import get_current_millis
|
||||
if DEBUG:
|
||||
from ...utils.debug_utils import dump_to_file
|
||||
|
@ -1 +1 @@
|
||||
from .old_config import config, read_config, write_config
|
||||
from .config import config, read_config, write_config
|
||||
|
@ -1,40 +0,0 @@
|
||||
from dynaconf import Dynaconf
|
||||
from dynaconf import settings
|
||||
from dynaconf.utils import object_merge
|
||||
|
||||
# from .path_manager import LOCATIONS
|
||||
|
||||
"""
|
||||
https://www.dynaconf.com/settings_files/
|
||||
|
||||
This file is there to load the settings.
|
||||
How I will structure this programm exactly is in the stars.
|
||||
|
||||
The concept is that I package a config file, with this programm, and then load it.
|
||||
Then I check if there is a config file at the LOCATIONS.CONFIG_FILE, and if yes they get merged
|
||||
"""
|
||||
|
||||
settings.happy_message = [
|
||||
"Support the artist.",
|
||||
"Star Me: https://github.com/HeIIow2/music-downloader",
|
||||
"🏳️⚧️🏳️⚧️ Trans rights are human rights. 🏳️⚧️🏳️⚧️",
|
||||
"🏳️⚧️🏳️⚧️ Trans women are women, trans men are men, and enbies are enbies. 🏳️⚧️🏳️⚧️",
|
||||
"🏴☠️🏴☠️ Unite under one flag, fck borders. 🏴☠️🏴☠️",
|
||||
"Join my Matrix Space: https://matrix.to/#/#music-kraken:matrix.org",
|
||||
"Gotta love the BPJM ;-;",
|
||||
"🏳️⚧️🏳️⚧️ Protect trans youth. 🏳️⚧️🏳️⚧️",
|
||||
"Nonstop Progressive Marxism.",
|
||||
]
|
||||
|
||||
|
||||
dynacont_object = Dynaconf(
|
||||
settings_files=[str(LOCATIONS.CONFIG_FILE)]
|
||||
)
|
||||
|
||||
|
||||
|
||||
class Settings:
|
||||
def __init__(self) -> None:
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ class Locations:
|
||||
|
||||
self.CONFIG_DIRECTORY = get_config_directory(str(application_name))
|
||||
self.CONFIG_DIRECTORY.mkdir(exist_ok=True, parents=True)
|
||||
self.CONFIG_FILE = Path(self.CONFIG_DIRECTORY, f"{application_name}.toml")
|
||||
self.CONFIG_FILE = Path(self.CONFIG_DIRECTORY, f"{application_name}.conf")
|
||||
self.LEGACY_CONFIG_FILE = Path(self.CONFIG_DIRECTORY, f"{application_name}.conf")
|
||||
|
||||
self.FFMPEG_BIN = Path(FFmpeg(enable_log=False).get_ffmpeg_bin())
|
||||
|
@ -5,7 +5,7 @@ from typing import List, Tuple, Set, Dict
|
||||
from urllib.parse import ParseResult
|
||||
|
||||
from .path_manager import LOCATIONS
|
||||
from .old_config import LOGGING_SECTION, AUDIO_SECTION, CONNECTION_SECTION, MISC_SECTION, PATHS_SECTION
|
||||
from .config import LOGGING_SECTION, AUDIO_SECTION, CONNECTION_SECTION, MISC_SECTION, PATHS_SECTION
|
||||
from .enums.album import AlbumType
|
||||
|
||||
CONFIG_FILE = LOCATIONS.CONFIG_FILE
|
||||
|
Loading…
Reference in New Issue
Block a user