This class indicates that the object is defined in a .proto file. This can be used for the `defined_in` slot of the `PageInfo` objects.
| 1604 | |
| 1605 | |
| 1606 | class _ProtoFile(object): |
| 1607 | """This class indicates that the object is defined in a .proto file. |
| 1608 | |
| 1609 | This can be used for the `defined_in` slot of the `PageInfo` objects. |
| 1610 | """ |
| 1611 | |
| 1612 | def __init__(self, path, parser_config): |
| 1613 | self.path = path |
| 1614 | self.path_prefix = parser_config.defined_in_prefix |
| 1615 | self.code_url_prefix = parser_config.code_url_prefix |
| 1616 | |
| 1617 | def is_builtin(self): |
| 1618 | return False |
| 1619 | |
| 1620 | def is_python_file(self): |
| 1621 | return False |
| 1622 | |
| 1623 | def is_generated_file(self): |
| 1624 | return False |
| 1625 | |
| 1626 | def __str__(self): |
| 1627 | return 'Defined in [`{prefix}{path}`]({code_prefix}{path}).\n\n'.format( |
| 1628 | path=self.path, prefix=self.path_prefix, |
| 1629 | code_prefix=self.code_url_prefix) |
| 1630 | |
| 1631 | |
| 1632 | class _GeneratedFile(object): |