aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/python
diff options
context:
space:
mode:
authorKrishna <krishna.nm86@gmail.com>2014-12-12 10:22:48 +0100
committerKrishna <krishna.nm86@gmail.com>2014-12-12 10:22:48 +0100
commit22f96a713cd68d051466de7aa4585cc64e674d80 (patch)
treedf30a801b576aabfab9b143da25f1621736e97a4 /src/google/protobuf/compiler/python
parent060a2096a3f3d7c66a64a1a41a1d2e1e18aea82d (diff)
downloadprotobuf-22f96a713cd68d051466de7aa4585cc64e674d80.tar.gz
protobuf-22f96a713cd68d051466de7aa4585cc64e674d80.tar.bz2
protobuf-22f96a713cd68d051466de7aa4585cc64e674d80.zip
Returned print_indent and print_outdent back to printservicestub and printserviceclass in python generator
Diffstat (limited to 'src/google/protobuf/compiler/python')
-rw-r--r--src/google/protobuf/compiler/python/python_generator.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/google/protobuf/compiler/python/python_generator.cc b/src/google/protobuf/compiler/python/python_generator.cc
index fca94a31..b30d1972 100644
--- a/src/google/protobuf/compiler/python/python_generator.cc
+++ b/src/google/protobuf/compiler/python/python_generator.cc
@@ -581,17 +581,14 @@ void Generator::PrintServiceDescriptor(
}
-void Generator::PrintDescriptorKeyAndModuleName(const ServiceDescriptor& descriptor) const {
- printer_->Indent();
+void Generator::PrintDescriptorKeyAndModuleName(const ServiceDescriptor& descriptor) const {
printer_->Print(
"$descriptor_key$ = $descriptor_name$,\n",
"descriptor_key", kDescriptorKey,
"descriptor_name", ModuleLevelServiceDescriptorName(descriptor));
printer_->Print(
"__module__ = '$module_name$'\n",
- "module_name", ModuleName(file_->name()));
- printer_->Print("))\n\n");
- printer_->Outdent();
+ "module_name", ModuleName(file_->name()));
}
void Generator::PrintServiceClass(const ServiceDescriptor& descriptor) const {
@@ -599,7 +596,10 @@ void Generator::PrintServiceClass(const ServiceDescriptor& descriptor) const {
printer_->Print("$class_name$ = service_reflection.GeneratedServiceType("
"'$class_name$', (_service.Service,), dict(\n",
"class_name", descriptor.name());
+ printer_->Indent();
Generator::PrintDescriptorKeyAndModuleName(descriptor);
+ printer_->Print("))\n\n");
+ printer_->Outdent();
}
void Generator::PrintServiceStub(const ServiceDescriptor& descriptor) const {
@@ -608,7 +608,10 @@ void Generator::PrintServiceStub(const ServiceDescriptor& descriptor) const {
"service_reflection.GeneratedServiceStubType("
"'$class_name$_Stub', ($class_name$,), dict(\n",
"class_name", descriptor.name());
+ printer_->Indent();
Generator::PrintDescriptorKeyAndModuleName(descriptor);
+ printer_->Print("))\n\n");
+ printer_->Outdent();
}
// Prints statement assigning ModuleLevelDescriptorName(message_descriptor)