2016-11-10 21:49:51 +01:00
|
|
|
import platform
|
2017-04-26 20:18:41 +02:00
|
|
|
import os
|
2018-11-09 20:02:03 +01:00
|
|
|
import logging.handlers
|
2016-11-10 21:49:51 +01:00
|
|
|
|
2018-09-17 22:31:44 +02:00
|
|
|
from lbrynet.schema import __version__ as schema_version
|
2017-04-26 20:18:41 +02:00
|
|
|
from lbrynet import build_type, __version__ as lbrynet_version
|
2018-09-19 18:42:12 +02:00
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
2016-11-10 21:49:51 +01:00
|
|
|
|
|
|
|
|
2018-11-08 00:35:32 +01:00
|
|
|
def get_platform() -> dict:
|
2016-11-10 21:49:51 +01:00
|
|
|
p = {
|
|
|
|
"processor": platform.processor(),
|
|
|
|
"python_version": platform.python_version(),
|
|
|
|
"platform": platform.platform(),
|
|
|
|
"os_release": platform.release(),
|
|
|
|
"os_system": platform.system(),
|
2018-11-09 19:06:02 +01:00
|
|
|
"lbrynet_version": lbrynet_version,
|
2018-09-17 22:31:44 +02:00
|
|
|
"lbryschema_version": schema_version,
|
2017-03-15 21:33:41 +01:00
|
|
|
"build": build_type.BUILD, # CI server sets this during build step
|
2016-11-10 21:49:51 +01:00
|
|
|
}
|
2018-05-29 00:07:23 +02:00
|
|
|
if p["os_system"] == "Linux":
|
2019-01-24 04:01:20 +01:00
|
|
|
import distro
|
|
|
|
p["distro"] = distro.info()
|
|
|
|
p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown')
|
2016-11-10 21:49:51 +01:00
|
|
|
|
|
|
|
return p
|