Use open-source defaults to propagate Python plugin configuration
diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc
index 15cda47..c5f1ed8 100644
--- a/src/compiler/python_generator.cc
+++ b/src/compiler/python_generator.cc
@@ -66,6 +66,9 @@
namespace grpc_python_generator {
+GeneratorConfiguration::GeneratorConfiguration()
+ : grpc_package_root("grpc"), beta_package_root("grpc.beta") {}
+
PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config)
: config_(config) {}
diff --git a/src/compiler/python_generator.h b/src/compiler/python_generator.h
index fc51b48..7ed99ef 100644
--- a/src/compiler/python_generator.h
+++ b/src/compiler/python_generator.h
@@ -43,6 +43,7 @@
// 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;
};
diff --git a/src/compiler/python_plugin.cc b/src/compiler/python_plugin.cc
index fc76ee5..3457aa6 100644
--- a/src/compiler/python_plugin.cc
+++ b/src/compiler/python_plugin.cc
@@ -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);
}
diff --git a/tools/distrib/python/grpcio_tools/grpc/tools/main.cc b/tools/distrib/python/grpcio_tools/grpc/tools/main.cc
index 81675b4..8391839 100644
--- a/tools/distrib/python/grpcio_tools/grpc/tools/main.cc
+++ b/tools/distrib/python/grpcio_tools/grpc/tools/main.cc
@@ -45,7 +45,6 @@
// 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.");