Finds the message and enum descriptors in the file. This method finds the message and enum descriptors from a file descriptor; it will visit the top-level messages, and within those the enums. Args: validator_pb2: The proto2 Python module generated from validator.proto. msg_desc_by_n
(validator_pb2, msg_desc_by_name, enum_desc_by_name)
| 37 | |
| 38 | |
| 39 | def FindDescriptors(validator_pb2, msg_desc_by_name, enum_desc_by_name): |
| 40 | """Finds the message and enum descriptors in the file. |
| 41 | |
| 42 | This method finds the message and enum descriptors from a file descriptor; |
| 43 | it will visit the top-level messages, and within those the enums. |
| 44 | |
| 45 | Args: |
| 46 | validator_pb2: The proto2 Python module generated from validator.proto. |
| 47 | msg_desc_by_name: A map of message descriptors, keyed by full_name. |
| 48 | enum_desc_by_name: A map of enum descriptors, keyed by full name. |
| 49 | """ |
| 50 | for msg_type in list(validator_pb2.DESCRIPTOR.message_types_by_name.values()): |
| 51 | msg_desc_by_name[msg_type.full_name] = msg_type |
| 52 | for enum_type in msg_type.enum_types: |
| 53 | enum_desc_by_name[enum_type.full_name] = enum_type |
| 54 | |
| 55 | |
| 56 | class OutputFormatter(object): |
no outgoing calls
no test coverage detected