Commit 0d466b63 authored by Asanka Herath's avatar Asanka Herath Committed by Commit Bot

[entropy] Emit an empty field instead of 'False'

This makes the emitted .csv much easier on the eyes and is better
suited for importing into spreadsheets etc.

Bug: 973801
Change-Id: Ic67ba5d251558830e1c27b59c3b3f69e962b7dc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2115693Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752469}
parent 6d768987
...@@ -4,19 +4,22 @@ ...@@ -4,19 +4,22 @@
""" """
Generate of table of APIs and their attributes based on the WebIDL database. Generate of table of APIs and their attributes based on the WebIDL database.
Each row of the table contains the following: The columns of the table are as follows:
* Interface or Namespace or Dictionary * interface : Name of interface.
* Name : The name of a method or property. * name : Member name. Will be empty for interfaces.
* Entity type : One of 'interface', 'namespace', 'const', 'attribute', * entity_type : One of 'interface', 'namespace', 'const', 'attribute',
'operation', 'constructor', 'stringifier', 'iterable', 'operation', 'constructor', 'stringifier', 'iterable',
'maplike', 'setlike', 'dictionary' 'maplike', 'setlike', 'dictionary'
* IDL Type : Type of the object. For function-like entries, this is the * idl_type : Type of the object. For function-like entries, this is the
type of the return value. Note that the type is stripped type of the return value. Note that the type is stripped
of nullable unions. of nullable unions.
* UseCounter : If usage is being measured, this is the UseCounter. * syntactic_form : Human readable idl_type.
* SecureContext? : 'SecureContext' or ''. * use_counter : If usage is being measured, this is the UseCounter.
* HighEntropy? : 'HighEntropy' or ''. * secure_context : 'True' if the [SecureContext] extended attribute is
present. Empty otherwise.
* high_entropy : 'True' if the [HighEntropy] extended attribute is present.
Empty otherwise.
""" """
import optparse import optparse
...@@ -52,6 +55,10 @@ def get_idl_type_name(idl_type): ...@@ -52,6 +55,10 @@ def get_idl_type_name(idl_type):
return unwrapped_type.type_name, unwrapped_type.syntactic_form return unwrapped_type.type_name, unwrapped_type.syntactic_form
def true_or_nothing(v):
return 'True' if v else ''
def record(csv_writer, entity): def record(csv_writer, entity):
interface = '' interface = ''
name = '' name = ''
...@@ -99,8 +106,8 @@ def record(csv_writer, entity): ...@@ -99,8 +106,8 @@ def record(csv_writer, entity):
'idl_type': idl_type, 'idl_type': idl_type,
'syntactic_form': syntactic_form, 'syntactic_form': syntactic_form,
'use_counter': use_counter, 'use_counter': use_counter,
'secure_context': secure_context, 'secure_context': true_or_nothing(secure_context),
'high_entropy': high_entropy 'high_entropy': true_or_nothing(high_entropy)
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment