refactor view.py type annotations
# Copyright (c) 2019-2022, Manfred Moitzi
# License: MIT License
-from typing import TYPE_CHECKING
+from __future__ import annotations
+from typing import TYPE_CHECKING, Optional
import logging
from ezdxf.lldxf import validator
@@ -21,7 +22,8 @@ from .factory import register_entity
logger = logging.getLogger("ezdxf")
if TYPE_CHECKING:
- from ezdxf.eztypes import TagWriter, DXFNamespace
+ from ezdxf.entities import DXFNamespace
+ from ezdxf.lldxf.tagwriter import AbstractTagWriter
__all__ = ["View"]
@@ -128,14 +130,14 @@ class View(DXFEntity):
DXFATTRIBS = DXFAttributes(base_class, acdb_symbol_table_record, acdb_view)
def load_dxf_attribs(
- self, processor: SubclassProcessor = None
- ) -> "DXFNamespace":
+ self, processor: Optional[SubclassProcessor] = None
+ ) -> DXFNamespace:
dxf = super().load_dxf_attribs(processor)
if processor:
processor.simple_dxfattribs_loader(dxf, acdb_view_group_codes) # type: ignore
return dxf
- def export_entity(self, tagwriter: "TagWriter") -> None:
+ def export_entity(self, tagwriter: AbstractTagWriter) -> None:
super().export_entity(tagwriter)
if tagwriter.dxfversion > DXF12:
tagwriter.write_tag2(SUBCLASS_MARKER, acdb_symbol_table_record.name)
