This class indicates that the object is defined in a generated python file. Generated files should not be linked to directly. This can be used for the `defined_in` slot of the `PageInfo` objects.
| 1630 | |
| 1631 | |
| 1632 | class _GeneratedFile(object): |
| 1633 | """This class indicates that the object is defined in a generated python file. |
| 1634 | |
| 1635 | Generated files should not be linked to directly. |
| 1636 | |
| 1637 | This can be used for the `defined_in` slot of the `PageInfo` objects. |
| 1638 | """ |
| 1639 | |
| 1640 | def __init__(self, path, parser_config): |
| 1641 | self.path = path |
| 1642 | self.path_prefix = parser_config.defined_in_prefix |
| 1643 | |
| 1644 | def is_builtin(self): |
| 1645 | return False |
| 1646 | |
| 1647 | def is_python_file(self): |
| 1648 | return False |
| 1649 | |
| 1650 | def is_generated_file(self): |
| 1651 | return True |
| 1652 | |
| 1653 | def __str__(self): |
| 1654 | return 'Defined in generated file: `%s%s`.\n\n' % (self.path_prefix, |
| 1655 | self.path) |
| 1656 | |
| 1657 | |
| 1658 | def _get_defined_in(py_object, parser_config): |