librespot-python/librespot/__init__.py

35 lines
1.1 KiB
Python
Raw Normal View History

2021-09-12 23:47:53 +02:00
from __future__ import annotations
from librespot.crypto import DiffieHellman
2021-08-24 07:43:18 +02:00
from librespot.proto.Keyexchange_pb2 import BuildInfo, Platform, Product, ProductFlags
from librespot.structure import Closeable, Runnable
2021-02-24 00:46:59 +01:00
import platform
class Version:
2022-06-28 13:55:10 +02:00
version_name = "0.0.4"
2021-02-24 00:46:59 +01:00
@staticmethod
def platform() -> Platform:
if platform.system() == "Windows":
return Platform.PLATFORM_WIN32_X86
if platform.system() == "Darwin":
2021-02-24 00:46:59 +01:00
return Platform.PLATFORM_OSX_X86
return Platform.PLATFORM_LINUX_X86
2021-02-24 00:46:59 +01:00
@staticmethod
def version_string():
2021-09-12 05:58:24 +02:00
return "librespot-python " + Version.version_name
2021-02-24 00:46:59 +01:00
@staticmethod
def system_info_string():
2021-09-12 05:58:24 +02:00
return Version.version_string() + \
"; Python " + platform.python_version() + \
"; " + platform.system()
2021-02-24 00:46:59 +01:00
@staticmethod
def standard_build_info() -> BuildInfo:
return BuildInfo(product=Product.PRODUCT_CLIENT,
product_flags=[ProductFlags.PRODUCT_FLAG_NONE],
platform=Version.platform(),
version=112800721)