Temporary data storage while reading a document. This class is only for internal use. Please don't use this in your extensions. It will be removed or changed without notice. The only stable API is via ``env.current_document``.
| 961 | |
| 962 | |
| 963 | class _CurrentDocument: |
| 964 | """Temporary data storage while reading a document. |
| 965 | |
| 966 | This class is only for internal use. Please don't use this in your extensions. |
| 967 | It will be removed or changed without notice. |
| 968 | The only stable API is via ``env.current_document``. |
| 969 | """ |
| 970 | |
| 971 | __slots__ = ( |
| 972 | '_parser', |
| 973 | '_serial_numbers', |
| 974 | '_extension_data', |
| 975 | 'autodoc_annotations', |
| 976 | 'autodoc_class', |
| 977 | 'autodoc_module', |
| 978 | 'c_last_symbol', |
| 979 | 'c_namespace_stack', |
| 980 | 'c_parent_symbol', |
| 981 | 'cpp_domain_name', |
| 982 | 'cpp_last_symbol', |
| 983 | 'cpp_namespace_stack', |
| 984 | 'cpp_parent_symbol', |
| 985 | 'default_domain', |
| 986 | 'default_role', |
| 987 | 'docname', |
| 988 | 'highlight_language', |
| 989 | 'obj_desc_name', |
| 990 | 'reading_started_at', |
| 991 | ) |
| 992 | |
| 993 | # Map of old-style temp_data keys to _CurrentDocument attributes |
| 994 | __attr_map: Final = { |
| 995 | '_parser': '_parser', |
| 996 | 'annotations': 'autodoc_annotations', |
| 997 | 'autodoc:class': 'autodoc_class', |
| 998 | 'autodoc:module': 'autodoc_module', |
| 999 | 'c:last_symbol': 'c_last_symbol', |
| 1000 | 'c:namespace_stack': 'c_namespace_stack', |
| 1001 | 'c:parent_symbol': 'c_parent_symbol', |
| 1002 | 'cpp:domain_name': 'cpp_domain_name', |
| 1003 | 'cpp:last_symbol': 'cpp_last_symbol', |
| 1004 | 'cpp:namespace_stack': 'cpp_namespace_stack', |
| 1005 | 'cpp:parent_symbol': 'cpp_parent_symbol', |
| 1006 | 'default_domain': 'default_domain', |
| 1007 | 'default_role': 'default_role', |
| 1008 | 'docname': 'docname', |
| 1009 | 'highlight_language': 'highlight_language', |
| 1010 | 'object': 'obj_desc_name', |
| 1011 | 'started_at': 'reading_started_at', |
| 1012 | } |
| 1013 | |
| 1014 | # Attributes that should reset to None if popped. |
| 1015 | __attr_default_none: Final = frozenset({ |
| 1016 | '_parser', |
| 1017 | 'c:last_symbol', |
| 1018 | 'c:parent_symbol', |
| 1019 | 'cpp:last_symbol', |
| 1020 | 'cpp:parent_symbol', |
no outgoing calls
searching dependent graphs…