From fe81fee82b88bda116a8fa552bb03d1afa17ed6f Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Tue, 9 Apr 2024 12:42:06 +0200 Subject: [PATCH] feat: cleanup --- music_kraken/pages/youtube_music/youtube_music.py | 2 +- music_kraken/utils/__init__.py | 7 +++++++ music_kraken/utils/functions.py | 11 ----------- 3 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 music_kraken/utils/functions.py diff --git a/music_kraken/pages/youtube_music/youtube_music.py b/music_kraken/pages/youtube_music/youtube_music.py index 516bafd..8ba1a5f 100644 --- a/music_kraken/pages/youtube_music/youtube_music.py +++ b/music_kraken/pages/youtube_music/youtube_music.py @@ -15,7 +15,7 @@ from youtube_dl.extractor.youtube import YoutubeIE from ...utils.exception.config import SettingValueError from ...utils.config import main_settings, youtube_settings, logging_settings from ...utils.shared import DEBUG, DEBUG_YOUTUBE_INITIALIZING -from ...utils.functions import get_current_millis +from ...utils import get_current_millis if DEBUG: from ...utils.debug_utils import dump_to_file diff --git a/music_kraken/utils/__init__.py b/music_kraken/utils/__init__.py index 94ef04c..3f6b07e 100644 --- a/music_kraken/utils/__init__.py +++ b/music_kraken/utils/__init__.py @@ -1,3 +1,5 @@ +from datetime import datetime + from .config import config, read_config, write_config from .enums.colors import BColors @@ -18,3 +20,8 @@ def output(msg: str, color: BColors = BColors.ENDC): def user_input(msg: str, color: BColors = BColors.ENDC): return input(_apply_color(msg, color)).strip() + + +def get_current_millis() -> int: + dt = datetime.now() + return int(dt.microsecond / 1_000) diff --git a/music_kraken/utils/functions.py b/music_kraken/utils/functions.py deleted file mode 100644 index f773213..0000000 --- a/music_kraken/utils/functions.py +++ /dev/null @@ -1,11 +0,0 @@ -import os -from datetime import datetime - - -def clear_console(): - os.system('cls' if os.name in ('nt', 'dos') else 'clear') - - -def get_current_millis() -> int: - dt = datetime.now() - return int(dt.microsecond / 1_000)