mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
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:
@@ -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")
|
||||
Reference in New Issue
Block a user