lbry-sdk/lbry/lbrynet/extras/system_info.py

31 lines
911 B
Python
Raw Normal View History

import platform
2017-04-26 20:18:41 +02:00
import os
2018-11-09 20:02:03 +01:00
import logging.handlers
2017-04-26 20:18:41 +02:00
from lbrynet import build_type, __version__ as lbrynet_version
from torba import __version__ as torba_version
log = logging.getLogger(__name__)
2018-11-08 00:35:32 +01:00
def get_platform() -> dict:
2019-05-17 20:00:25 +02:00
os_system = platform.system()
if os.environ and 'ANDROID_ARGUMENT' in os.environ:
os_system = 'android'
p = {
"processor": platform.processor(),
"python_version": platform.python_version(),
"platform": platform.platform(),
"os_release": platform.release(),
2019-05-17 20:00:25 +02:00
"os_system": os_system,
"lbrynet_version": lbrynet_version,
"torba_version": torba_version,
2017-03-15 21:33:41 +01:00
"build": build_type.BUILD, # CI server sets this during build step
}
if p["os_system"] == "Linux":
import distro
p["distro"] = distro.info()
p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown')
return p