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

Side by Side Diff: third_party/dom_distiller_js/protoc_plugins/util/plugin.py

Issue 2034373002: Generate the proto JSON converter for DOM distiller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import sys
6
7 import plugin_protos
8 import types
9
10
11 def Debug(data):
12 sys.stderr.write(str(data))
13 sys.stderr.write('\n')
14 sys.stderr.flush()
15
16
17 def TitleCase(s):
18 return ''.join((p[0].upper() + p[1:] for p in s.split('_')))
nyquist 2016/06/14 00:48:11 Do you need the inner parenthesis here?
wychen 2016/08/07 09:16:27 Done.
19
20
21 def Indented(s, indent=2):
22 return '\n'.join((' ' * indent) + p for p in s.rstrip('\n').split('\n'))
23
24
25 proto_path_to_file_map = {}
26
27
28 def RegisterProtoFile(proto_file):
29 proto_path_to_file_map[proto_file.Filename()] = proto_file
30 types.RegisterTypesForFile(proto_file)
31
32
33 def GetProtoFileForFilename(filename):
34 proto_file = proto_path_to_file_map[filename]
35 assert proto_file
36 return proto_file
37
38
39 def ReadRequestFromStdin():
40 data = sys.stdin.read()
41 return plugin_protos.PluginRequestFromString(data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698