def main(command_arguments): """Run the protocol buffer compiler with the given command-line arguments. Args: command_arguments: a list of strings representing command line arguments to `protoc`. """ command_arguments = [argument.encode() for argument in command_arguments] return _protoc_compiler.run_main(command_arguments)
def main(command_arguments): """Run the protocol buffer compiler with the given command-line arguments. Args: command_arguments: a list of strings representing command line arguments to `protoc`. """ command_arguments = [argument.encode() for argument in command_arguments] return _protoc_compiler.run_main(command_arguments)
def main(command_arguments, include_module_proto=True): """Run the protocol buffer compiler with the given command-line arguments. Args: command_arguments: A list of strings representing command line arguments to `protoc`. include_module_proto: Wether `*.proto` files comming with the current py-module will be included too. """ if include_module_proto: proto_include = pkg_resources.resource_filename('grpc_tools', '_proto') command_arguments.append('-I{}'.format(proto_include)) command_arguments = [os.path.abspath(__file__)] + command_arguments command_arguments = [argument.encode() for argument in command_arguments] return _protoc_compiler.run_main(command_arguments)