Skip to content

Commit

Permalink
Merge pull request grpc#7188 from kpayson64/grpcio_tools_fix
Browse files Browse the repository at this point in the history
Use open-source defaults to propagate Python plugin configuration
  • Loading branch information
nicolasnoble authored Jul 1, 2016
2 parents d3812c9 + 8a15dd2 commit aab31a5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/compiler/python_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ using std::vector;

namespace grpc_python_generator {

GeneratorConfiguration::GeneratorConfiguration()
: grpc_package_root("grpc"), beta_package_root("grpc.beta") {}

PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config)
: config_(config) {}

Expand Down
1 change: 1 addition & 0 deletions src/compiler/python_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace grpc_python_generator {
// Data pertaining to configuration of the generator with respect to anything
// that may be used internally at Google.
struct GeneratorConfiguration {
GeneratorConfiguration();
grpc::string grpc_package_root;
grpc::string beta_package_root;
};
Expand Down
2 changes: 0 additions & 2 deletions src/compiler/python_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

int main(int argc, char* argv[]) {
grpc_python_generator::GeneratorConfiguration config;
config.grpc_package_root = "grpc";
config.beta_package_root = "grpc.beta";
grpc_python_generator::PythonGrpcGenerator generator(config);
return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
}
1 change: 0 additions & 1 deletion tools/distrib/python/grpcio_tools/grpc/tools/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ int protoc_main(int argc, char* argv[]) {

// gRPC Python
grpc_python_generator::GeneratorConfiguration grpc_py_config;
grpc_py_config.beta_package_root = "grpc.beta";
grpc_python_generator::PythonGrpcGenerator grpc_py_generator(grpc_py_config);
cli.RegisterGenerator("--grpc_python_out", &grpc_py_generator,
"Generate Python source file.");
Expand Down

0 comments on commit aab31a5

Please sign in to comment.