From a1ce6befb37d243ab509f5d9d4ae18bd85e6ede9 Mon Sep 17 00:00:00 2001 From: Denis Kuzmenok Date: Tue, 21 Nov 2017 11:17:58 +0200 Subject: [PATCH] added printer to os detection --- resources/site-packages/elementum/osarch.py | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/resources/site-packages/elementum/osarch.py b/resources/site-packages/elementum/osarch.py index f398827c5..b7c9546de 100644 --- a/resources/site-packages/elementum/osarch.py +++ b/resources/site-packages/elementum/osarch.py @@ -1,6 +1,7 @@ import xbmc import sys import platform +from elementum.logger import log def get_platform(): build = xbmc.getInfoLabel("System.BuildVersion") @@ -12,6 +13,8 @@ def get_platform(): "kodi": kodi_version, "build": build } + + dump_version() if xbmc.getCondVisibility("system.platform.android"): ret["os"] = "android" if "arm" in platform.machine() or "aarch" in platform.machine(): @@ -45,5 +48,33 @@ def get_platform(): ret["arch"] = "arm-7" return ret +def linux_distribution(): + try: + return platform.linux_distribution() + except: + return "N/A" + +def dump_version(): + log.info("""Python version: %s + dist: %s + linux_distribution: %s + system: %s + machine: %s + platform: %s + uname: %s + version: %s + mac_ver: %s + """ % ( + sys.version.split('\n'), + str(platform.dist()), + linux_distribution(), + platform.system(), + platform.machine(), + platform.platform(), + platform.uname(), + platform.version(), + platform.mac_ver(), + )) + PLATFORM = get_platform()