MCPcopy Index your code
hub / github.com/ampproject/amphtml / GenValidatorPb2Py

Function GenValidatorPb2Py

validator/build.py:136–149  ·  view source on GitHub ↗

Calls the proto compiler to generate validator_pb2.py. Args: out_dir: directory name of the output directory. Must not have slashes, dots, etc.

(out_dir)

Source from the content-addressed store, hash-verified

134
135
136def GenValidatorPb2Py(out_dir):
137 """Calls the proto compiler to generate validator_pb2.py.
138
139 Args:
140 out_dir: directory name of the output directory. Must not have slashes,
141 dots, etc.
142 """
143 logging.info('entering ...')
144 assert re.match(r'^[a-zA-Z_\-0-9]+$', out_dir), 'bad out_dir: %s' % out_dir
145
146 subprocess.check_call(
147 ['protoc', 'validator.proto', '--python_out=%s' % out_dir])
148 open('%s/__init__.py' % out_dir, 'w').close()
149 logging.info('... done')
150
151
152def GenValidatorProtoascii(out_dir):

Callers 1

MainFunction · 0.85

Calls 3

openFunction · 0.85
infoMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected