summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/model.py
diff options
context:
space:
mode:
authorevan.peterson.EP@gmail.com <evan.peterson.EP@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-23 04:24:55 +0000
committerevan.peterson.EP@gmail.com <evan.peterson.EP@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-23 04:24:55 +0000
commit8426f8d77f00969b40a39f4d3b58f545e36ac9b3 (patch)
treed36927b36e91387b08e038f83cab194d9301aae4 /tools/json_schema_compiler/model.py
parent424088849de595795caeb5d947764021681114ba (diff)
downloadchromium_src-8426f8d77f00969b40a39f4d3b58f545e36ac9b3.zip
chromium_src-8426f8d77f00969b40a39f4d3b58f545e36ac9b3.tar.gz
chromium_src-8426f8d77f00969b40a39f4d3b58f545e36ac9b3.tar.bz2
Add descriptions to all extension/app schemas, and enforce that they have them
from now on. BUG=233968 R=kalman@chromium.org TBR=yoz@chromium.org Review URL: https://chromiumcodereview.appspot.com/16876004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/model.py')
-rw-r--r--tools/json_schema_compiler/model.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index d6b6efc..d49c18f 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -39,6 +39,7 @@ class Namespace(object):
Properties:
- |name| the name of the namespace
+ - |description| the description of the namespace
- |unix_name| the unix_name of the namespace
- |source_file| the file that contained the namespace definition
- |source_file_dir| the directory component of |source_file|
@@ -54,6 +55,10 @@ class Namespace(object):
"""
def __init__(self, json, source_file, include_compiler_options=False):
self.name = json['namespace']
+ if 'description' not in json:
+ raise ValueError('%s must have a "description" field. This will appear '
+ 'on the API summary page.' % self.name)
+ self.description = json.get('description', None)
self.unix_name = UnixName(self.name)
self.source_file = source_file
self.source_file_dir, self.source_file_filename = os.path.split(source_file)