diff --git a/.gitignore b/.gitignore index a219440..3153631 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ __pycache__ token *.egg-info dist +.venv* diff --git a/MANIFEST.in b/MANIFEST.in index 8093fe4..3a50493 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -recursive-include data * +recursive-include yami/data * recursive-include .assets * \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 53c0ab9..353eaa7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "yami-music-player" -version = "1.0.0" +version = "1.0.1" description="An open-source music player with simple UI" readme = "README.md" requires-python = ">=3.8" @@ -44,7 +44,7 @@ include-package-data = true where=["."] [tool.setuptools.package-data] -yami = ["./data/*"] +yami = ["./yami/data/*"] [project.scripts] yami = "yami.main:entry" diff --git a/requirements.txt b/requirements.txt index 243a9e7..3734ff5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ mutagen==1.47.0 Pillow==11.0.0 pygame==2.6.1 spotdl==4.2.8 +tk diff --git a/yami/__init__.py b/yami/__init__.py index 733f627..7e33773 100644 --- a/yami/__init__.py +++ b/yami/__init__.py @@ -1,3 +1 @@ from .music import MusicPlayer - -__all__ = ["MusicPlayer"] diff --git a/data/cover.ico b/yami/data/cover.ico similarity index 100% rename from data/cover.ico rename to yami/data/cover.ico diff --git a/data/folder.png b/yami/data/folder.png similarity index 100% rename from data/folder.png rename to yami/data/folder.png diff --git a/data/icon.png b/yami/data/icon.png similarity index 100% rename from data/icon.png rename to yami/data/icon.png diff --git a/data/image.png b/yami/data/image.png similarity index 100% rename from data/image.png rename to yami/data/image.png diff --git a/data/music.png b/yami/data/music.png similarity index 100% rename from data/music.png rename to yami/data/music.png diff --git a/data/oldpic.png b/yami/data/oldpic.png similarity index 100% rename from data/oldpic.png rename to yami/data/oldpic.png diff --git a/data/pause.png b/yami/data/pause.png similarity index 100% rename from data/pause.png rename to yami/data/pause.png diff --git a/data/play_arrow.png b/yami/data/play_arrow.png similarity index 100% rename from data/play_arrow.png rename to yami/data/play_arrow.png diff --git a/data/skip_next.png b/yami/data/skip_next.png similarity index 100% rename from data/skip_next.png rename to yami/data/skip_next.png diff --git a/data/skip_prev.png b/yami/data/skip_prev.png similarity index 100% rename from data/skip_prev.png rename to yami/data/skip_prev.png diff --git a/data/theme.json b/yami/data/theme.json similarity index 100% rename from data/theme.json rename to yami/data/theme.json diff --git a/yami/main.py b/yami/main.py index b12aeb7..a8e0ea9 100644 --- a/yami/main.py +++ b/yami/main.py @@ -9,3 +9,6 @@ def entry(): app = MusicPlayer() app.mainloop() + +if __name__=="__main__": + entry() diff --git a/yami/music.py b/yami/music.py index 084912e..3aa8018 100644 --- a/yami/music.py +++ b/yami/music.py @@ -5,11 +5,11 @@ import tempfile import asyncio import logging -import os + from mutagen import File, id3 import customtkinter as ctk -from PIL import Image, ImageDraw,ImageTk +from PIL import Image, ImageDraw import spotdl import pygame @@ -21,7 +21,7 @@ from .util import GEOMETRY, TITLE, PlayerState, EVENT_INTERVAL -ctk.set_default_color_theme("data/theme.json") +ctk.set_default_color_theme("yami/data/theme.json") ctk.set_appearance_mode("dark") @@ -35,10 +35,6 @@ def __init__(self: ctk.CTk, loop=None): # CONFIG self.geometry(GEOMETRY) self.title(TITLE) - self.attributes("-alpha", 0.4) - self.iconpath = ImageTk.PhotoImage(file=os.path.join(".assets","default.png")) - self.wm_iconbitmap() - self.iconphoto(False, self.iconpath) # STATE self.playlist = [] @@ -245,12 +241,12 @@ def check_for_events(self): self.play_next_song() def setup_icons(self): - self.play_icon = ctk.CTkImage(Image.open("data/play_arrow.png")) - self.pause_icon = ctk.CTkImage(Image.open("data/pause.png")) - self.prev_icon = ctk.CTkImage(Image.open("data/skip_prev.png")) - self.next_icon = ctk.CTkImage(Image.open("data/skip_next.png")) - self.folder_icon = ctk.CTkImage(Image.open("data/folder.png")) - self.music_icon = ctk.CTkImage(Image.open("data/music.png")) + self.play_icon = ctk.CTkImage(Image.open("yami/data/play_arrow.png")) + self.pause_icon = ctk.CTkImage(Image.open("yami/data/pause.png")) + self.prev_icon = ctk.CTkImage(Image.open("yami/data/skip_prev.png")) + self.next_icon = ctk.CTkImage(Image.open("yami/data/skip_next.png")) + self.folder_icon = ctk.CTkImage(Image.open("yami/data/folder.png")) + self.music_icon = ctk.CTkImage(Image.open("yami/data/music.png")) logging.info("icons setup") def setup_bindings(self):