feat: auto disable debug on deploy
This commit is contained in:
parent
f009bf7bb8
commit
db8e54cd1c
2
.gitignore
vendored
2
.gitignore
vendored
@ -16,3 +16,5 @@ venv
|
||||
.idea/aws.xml
|
||||
|
||||
windows
|
||||
|
||||
.env
|
||||
|
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -17,6 +17,7 @@
|
||||
"python.formatting.provider": "none",
|
||||
"cSpell.words": [
|
||||
"Bandcamp",
|
||||
"dotenv",
|
||||
"levenshtein",
|
||||
"OKBLUE"
|
||||
]
|
||||
|
@ -378,6 +378,9 @@ class Page:
|
||||
if not (isinstance(music_object, Song) and self.NO_ADDITIONAL_DATA_FROM_SONG):
|
||||
self.fetch_details(music_object=music_object, stop_at_level=1)
|
||||
|
||||
if isinstance(music_object, Song):
|
||||
trace(music_object.option_string)
|
||||
|
||||
naming_dict.add_object(music_object)
|
||||
|
||||
if isinstance(music_object, Song):
|
||||
|
@ -3,7 +3,7 @@ from pathlib import Path
|
||||
import json
|
||||
import logging
|
||||
|
||||
from .shared import DEBUG, DEBUG_LOGGING, DEBUG_DUMP
|
||||
from .shared import DEBUG, DEBUG_LOGGING, DEBUG_DUMP, DEBUG_TRACE
|
||||
from .config import config, read_config, write_config
|
||||
from .enums.colors import BColors
|
||||
from .path_manager import LOCATIONS
|
||||
@ -47,7 +47,7 @@ def dump_to_file(file_name: str, payload: str, is_json: bool = False, exit_after
|
||||
|
||||
|
||||
def trace(msg: str):
|
||||
if DEBUG_LOGGING:
|
||||
if DEBUG_TRACE:
|
||||
logging.debug(msg)
|
||||
|
||||
output("trace: " + msg, BColors.OKBLUE)
|
||||
|
@ -1,10 +1,20 @@
|
||||
import random
|
||||
from dotenv import load_dotenv
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
|
||||
from .path_manager import LOCATIONS
|
||||
from .config import main_settings
|
||||
|
||||
DEBUG = True
|
||||
if not load_dotenv(Path(__file__).parent.parent.parent / ".env"):
|
||||
load_dotenv(Path(__file__).parent.parent.parent / ".env.example")
|
||||
|
||||
__stage__ = os.getenv("STAGE", "prod")
|
||||
|
||||
DEBUG = __stage__ == "dev" and True
|
||||
DEBUG_LOGGING = DEBUG and False
|
||||
DEBUG_TRACE = DEBUG and True
|
||||
DEBUG_YOUTUBE_INITIALIZING = DEBUG and False
|
||||
DEBUG_PAGES = DEBUG and False
|
||||
DEBUG_DUMP = DEBUG and True
|
||||
|
@ -51,6 +51,7 @@ dependencies = [
|
||||
"transliterate~=1.10.2",
|
||||
"pycountry~=24.0.1",
|
||||
|
||||
"python-dotenv~=1.0.1",
|
||||
"tqdm~=4.65.0",
|
||||
"platformdirs~=4.2.0",
|
||||
"pathvalidate~=2.5.2",
|
||||
|
Loading…
Reference in New Issue
Block a user