diff options
author | 2018-01-02 14:40:00 -0800 | |
---|---|---|
committer | 2018-01-02 14:40:00 -0800 | |
commit | 87cd994b0477e98c976e7b321b3c1f52666ab5e0 (patch) | |
tree | 8590a82e599e0c763f32f835ef2bbb129871e75b /tools/codegen/core/gen_stats_data.py | |
parent | 63392f682e21543099926251b642cdcd0be2a17f (diff) |
Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
Diffstat (limited to 'tools/codegen/core/gen_stats_data.py')
-rwxr-xr-x | tools/codegen/core/gen_stats_data.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py index 93f2035c45..5c9d9e5ea5 100755 --- a/tools/codegen/core/gen_stats_data.py +++ b/tools/codegen/core/gen_stats_data.py @@ -28,8 +28,8 @@ REQUIRED_FIELDS = ['name', 'doc'] def make_type(name, fields): - return (collections.namedtuple( - name, ' '.join(list(set(REQUIRED_FIELDS + fields)))), []) + return (collections.namedtuple(name, ' '.join( + list(set(REQUIRED_FIELDS + fields)))), []) def c_str(s, encoding='ascii'): @@ -44,7 +44,10 @@ def c_str(s, encoding='ascii'): return '"' + result + '"' -types = (make_type('Counter', []), make_type('Histogram', ['max', 'buckets']),) +types = ( + make_type('Counter', []), + make_type('Histogram', ['max', 'buckets']), +) inst_map = dict((t[0].__name__, t[1]) for t in types) @@ -349,8 +352,8 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C: print >> C, "const int grpc_stats_histo_start[%d] = {%s};" % ( len(inst_map['Histogram']), ','.join('%s' % x for x in histo_start)) print >> C, "const int *const grpc_stats_histo_bucket_boundaries[%d] = {%s};" % ( - len(inst_map['Histogram']), ','.join('grpc_stats_table_%d' % x - for x in histo_bucket_boundaries)) + len(inst_map['Histogram']), ','.join( + 'grpc_stats_table_%d' % x for x in histo_bucket_boundaries)) print >> C, "void (*const grpc_stats_inc_histogram[%d])(int x) = {%s};" % ( len(inst_map['Histogram']), ','.join( 'grpc_stats_inc_%s' % histogram.name.lower() |