Display mpd-now-playable version on launch
This commit is contained in:
parent
fd7866ed14
commit
796e3df87d
3 changed files with 5 additions and 0 deletions
|
@ -48,6 +48,8 @@ check = {composite = ['lint', 'typecheck']}
|
||||||
|
|
||||||
[tool.pdm.version]
|
[tool.pdm.version]
|
||||||
source = "scm"
|
source = "scm"
|
||||||
|
write_to = 'mpd_now_playable/__version__.py'
|
||||||
|
write_template = "__version__ = '{}'"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["pdm-backend"]
|
requires = ["pdm-backend"]
|
||||||
|
|
1
src/mpd_now_playable/__version__.py
Normal file
1
src/mpd_now_playable/__version__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
__version__ = '0.0.1'
|
|
@ -3,6 +3,7 @@ from os import environ
|
||||||
|
|
||||||
from corefoundationasyncio import CoreFoundationEventLoop
|
from corefoundationasyncio import CoreFoundationEventLoop
|
||||||
|
|
||||||
|
from .__version__ import __version__
|
||||||
from .cocoa.now_playing import CocoaNowPlaying
|
from .cocoa.now_playing import CocoaNowPlaying
|
||||||
from .mpd.listener import MpdStateListener
|
from .mpd.listener import MpdStateListener
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ async def listen() -> None:
|
||||||
if password is None and "@" in host:
|
if password is None and "@" in host:
|
||||||
password, host = host.split("@", maxsplit=1)
|
password, host = host.split("@", maxsplit=1)
|
||||||
|
|
||||||
|
print(f"mpd-now-playable v{__version__}")
|
||||||
listener = MpdStateListener(cache)
|
listener = MpdStateListener(cache)
|
||||||
now_playing = CocoaNowPlaying(listener)
|
now_playing = CocoaNowPlaying(listener)
|
||||||
await listener.start(host=host, port=port, password=password)
|
await listener.start(host=host, port=port, password=password)
|
||||||
|
|
Loading…
Reference in a new issue