OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os.path | 5 import os.path |
6 | 6 |
7 from json_parse import OrderedDict | 7 from json_parse import OrderedDict |
8 from memoize import memoize | 8 from memoize import memoize |
9 | 9 |
10 class ParseException(Exception): | 10 class ParseException(Exception): |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
479 class Platforms(object): | 479 class Platforms(object): |
480 """Enum of the possible platforms. | 480 """Enum of the possible platforms. |
481 """ | 481 """ |
482 CHROMEOS = _PlatformInfo("chromeos") | 482 CHROMEOS = _PlatformInfo("chromeos") |
483 CHROMEOS_TOUCH = _PlatformInfo("chromeos_touch") | 483 CHROMEOS_TOUCH = _PlatformInfo("chromeos_touch") |
484 LINUX = _PlatformInfo("linux") | 484 LINUX = _PlatformInfo("linux") |
485 MAC = _PlatformInfo("mac") | 485 MAC = _PlatformInfo("mac") |
486 WIN = _PlatformInfo("win") | 486 WIN = _PlatformInfo("win") |
487 | 487 |
488 def _GetPlatforms(json): | 488 def _GetPlatforms(json): |
489 if 'platforms' not in json: | 489 if 'platforms' not in json or not json['platforms']: |
not at google - send to devlin
2013/10/25 17:00:08
again, empty-platform-list should be error not all
Haojian Wu
2013/10/26 03:15:51
Done.
| |
490 return None | 490 return None |
491 platforms = [] | 491 platforms = [] |
492 for platform_name in json['platforms']: | 492 for platform_name in json['platforms']: |
493 for platform_enum in _Enum.GetAll(Platforms): | 493 for platform_enum in _Enum.GetAll(Platforms): |
494 if platform_name == platform_enum.name: | 494 if platform_name == platform_enum.name: |
495 platforms.append(platform_enum) | 495 platforms.append(platform_enum) |
496 break | 496 break |
497 return platforms | 497 return platforms |
OLD | NEW |