mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-24 02:04:09 +03:00
Added "Chrome OS", and fixed the "unknown os" bug
This commit is contained in:
parent
8ad77c736d
commit
8d00883213
@ -40,6 +40,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# Knowns OSs
|
||||
Linux = 'Linux'
|
||||
ChromeOS = 'CrOS'
|
||||
WindowsPhone = 'Windows Phone'
|
||||
Windows = 'Windows'
|
||||
Macintosh = 'Mac'
|
||||
@ -48,9 +49,9 @@ iPad = 'iPad'
|
||||
iPhone = 'iPhone'
|
||||
Unknown = 'Unknown'
|
||||
|
||||
knownOss = (WindowsPhone, Android, Linux, Windows, Macintosh, iPad, iPhone) # Android is linux also, so it is cheched on first place
|
||||
knownOss = (WindowsPhone, Android, Linux, Windows, Macintosh, iPad, iPhone, ChromeOS) # Android is linux also, so it is cheched on first place
|
||||
|
||||
allOss = tuple(knownOss) + tuple(Unknown)
|
||||
allOss = (knownOss) + (Unknown,)
|
||||
desktopOss = (Linux, Windows, Macintosh)
|
||||
mobilesODD = list(set(allOss) - set(desktopOss))
|
||||
|
||||
@ -96,7 +97,7 @@ def getOsFromUA(ua):
|
||||
if ua is None:
|
||||
ua = Unknown
|
||||
|
||||
os = Android
|
||||
os = Unknown
|
||||
|
||||
res = DictAsObj({'OS': os, 'Version': '0.0', 'Browser': 'unknown'})
|
||||
for os in knownOss:
|
||||
|
Loading…
x
Reference in New Issue
Block a user