chore(constants): create constants module to store useful constants

This commit is contained in:
Benex254
2024-08-05 09:47:03 +03:00
parent 25f73b8c9f
commit 5ab3eec41f
9 changed files with 44 additions and 42 deletions

View File

@@ -4,7 +4,9 @@ import subprocess
import click
from rich import print
from ... import USER_CONFIG_PATH
from fastanime.cli.config import Config
from ...constants import USER_CONFIG_PATH
from ..utils.tools import exit_app
@@ -13,7 +15,8 @@ from ..utils.tools import exit_app
short_help="Edit your config",
)
@click.option("--path", "-p", help="Print the config location and exit", is_flag=True)
def configure(path):
@click.pass_obj
def configure(config: Config, path):
if path:
print(USER_CONFIG_PATH)
else:

View File

@@ -3,8 +3,8 @@ from configparser import ConfigParser
from rich import print
from .. import USER_CONFIG_PATH, USER_VIDEOS_DIR
from ..AnimeProvider import AnimeProvider
from ..constants import USER_CONFIG_PATH, USER_VIDEOS_DIR
from ..Utility.user_data_helper import user_data_helper

View File

@@ -5,7 +5,7 @@ from threading import Thread
import requests
from ... import APP_CACHE_DIR
from ...constants import APP_CACHE_DIR
from ...libs.anilist.anilist_data_schema import AnilistBaseMediaDataSchema
from ...Utility import anilist_data_helper
from ...Utility.utils import remove_html_tags, sanitize_filename

View File

@@ -18,7 +18,7 @@ def exit_app(*args):
from rich import print
from ... import USER_NAME
from ...constants import USER_NAME
print("Have a good day :smile:", USER_NAME)
sys.exit(0)

View File

@@ -4,7 +4,7 @@ import os
from InquirerPy import inquirer
from thefuzz import fuzz
from ... import PLATFORM
from ...constants import PLATFORM
from ...Utility.data import anime_normalizer
logger = logging.getLogger(__name__)