Commit 22f96a71 authored by Krishna's avatar Krishna

Returned print_indent and print_outdent back to printservicestub and…

Returned print_indent and print_outdent back to printservicestub and printserviceclass in python generator
parent 060a2096
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment