Skip to content

Commit

Permalink
added printer to os detection
Browse files Browse the repository at this point in the history
  • Loading branch information
elgatito committed Nov 21, 2017
1 parent f0e0670 commit a1ce6be
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions resources/site-packages/elementum/osarch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import xbmc
import sys
import platform
from elementum.logger import log

def get_platform():
build = xbmc.getInfoLabel("System.BuildVersion")
Expand All @@ -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():
Expand Down Expand Up @@ -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()

0 comments on commit a1ce6be

Please sign in to comment.