You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
792 B
Python

# from .._internal.methods import platform as _discover
def _match(x: int, y: int) -> str:
try:
if x==0: # Kernal Family
return {
0: 'Unknown',
1: 'Unknown POSIX',
2: 'Unix',
3: 'Linux',
4: 'Windows NT',
5: 'BSD',
6: 'Unknown BSD'
}[y]
else:
raise RuntimeError('invalid x id from discovery methods')
except IndexError:
return {
0: 'Unknown'
}[x]
except RuntimeError as e:
raise e
def getOSValue(item: str) -> list:
try:
return {
'osFamily': _match(0,_discover.find('OS_FAMILY'))
}[item]
except IndexError as e:
return None
def dumpOSInfo() -> dict:
return