def _get_os_type():
os_type = OSType.unknown[0]
# Figure out the general OS type
uname = platform.system().strip().strip('"').strip("'").strip().lower()
if 'beos' in uname or 'haiku' in uname:
os_type = OSType.BeOS[0]
elif 'bsd' in uname or 'gnu/kfreebsd' in uname:
os_type = OSType.BSD[0]
elif 'cygwin' in uname:
os_type = OSType.Cygwin[0]
elif 'darwin' in uname:
os_type = OSType.MacOS[0]
elif 'linux' in uname:
os_type = OSType.Linux[0]
elif 'solaris' in uname or 'sunos' in uname:
os_type = OSType.Solaris[0]
elif 'windows' in uname:
os_type = OSType.Windows[0]
return os_type
评论列表
文章目录