Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1422)

Side by Side Diff: tools/json_schema_compiler/model.py

Issue 38573008: Add "platforms" key in IDL schema compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment issues Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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/28 17:04:48 if "platforms" can't be empty then this change doe
Haojian Wu 2013/10/29 02:09:32 The statement "not json['platforms']"'s aim is to
not at google - send to devlin 2013/10/29 14:36:52 How is platforms None? There are three false state
Haojian Wu 2013/10/30 00:42:47 The third false states: platforms set to None, the
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698