modularize src

+ merge main.py and manage.py
+ move start logic to swingmusic/__main__.py
+ add a run.py on the project root
This commit is contained in:
cwilvx
2025-05-25 20:35:54 +03:00
parent 76fc97e088
commit 86fabcd5e3
171 changed files with 658 additions and 627 deletions
+26
View File
@@ -0,0 +1,26 @@
from swingmusic.settings import TCOLOR, Info, Paths
from swingmusic.utils.network import get_ip
import click
def log_startup_info(host: str, port: int):
# lines = "-"*30
# clears terminal 👇
# os.system("cls" if os.name == "nt" else "echo -e \\\\033c")
click.echo(f"{TCOLOR.HEADER}Swing Music v{Info.SWINGMUSIC_APP_VERSION} {TCOLOR.ENDC}")
addresses = [host]
if host == "0.0.0.0":
remote_ip = get_ip()
addresses.extend(["127.0.0.1"] + ([remote_ip] if remote_ip else []))
click.echo("Server running on:\n")
for address in addresses:
click.echo(
f"{TCOLOR.OKGREEN}http://{address}:{port}{TCOLOR.ENDC}"
)
click.echo("")
click.echo(f"{TCOLOR.YELLOW}Data folder: {Paths.get_app_dir()}{TCOLOR.ENDC}\n")