9
9
from server .utils import get_setting
10
10
11
11
12
- # This table is also used for sequnecing output, so use OrderedDict.
12
+ # This table is also used for sequencing output, so use OrderedDict.
13
13
OS_TABLE = OrderedDict (Darwin = 'macOS' , Windows = 'Windows' , Linux = 'Linux' , ChromeOS = 'Chrome OS' )
14
14
15
15
@@ -32,8 +32,9 @@ def get_context(self, machines, **kwargs):
32
32
33
33
grouped = defaultdict (list )
34
34
for version in os_info :
35
- os_type = OS_TABLE [version ['os_family' ]]
36
- grouped [os_type ].append (version )
35
+ os_type = OS_TABLE .get (version ['os_family' ])
36
+ if os_type :
37
+ grouped [os_type ].append (version )
37
38
38
39
normalize_chromeos_versions = get_setting ('normalize_chromeos_versions' )
39
40
if normalize_chromeos_versions :
@@ -63,7 +64,7 @@ def get_context(self, machines, **kwargs):
63
64
chrome_items .append (item_to_add )
64
65
65
66
grouped ['Chrome OS' ] = chrome_items
66
- # you and your lanbda's @sheacraig...
67
+ # you and your lambdas @sheacraig...
67
68
os_key = lambda x : LooseVersion (x ["operating_system" ]) # noqa: E731
68
69
output = [
69
70
(key , sorted (grouped [key ], key = os_key , reverse = True )) for key in OS_TABLE .values ()]
0 commit comments