Return an instance of the appropriate shape proxy class for `shape_elm`.
(shape_elm: ShapeElement, parent: ProvidesPart)
| 801 | |
| 802 | |
| 803 | def BaseShapeFactory(shape_elm: ShapeElement, parent: ProvidesPart) -> BaseShape: |
| 804 | """Return an instance of the appropriate shape proxy class for `shape_elm`.""" |
| 805 | tag = shape_elm.tag |
| 806 | |
| 807 | if isinstance(shape_elm, CT_Picture): |
| 808 | videoFiles = shape_elm.xpath("./p:nvPicPr/p:nvPr/a:videoFile") |
| 809 | if videoFiles: |
| 810 | return Movie(shape_elm, parent) |
| 811 | return Picture(shape_elm, parent) |
| 812 | |
| 813 | shape_cls = { |
| 814 | qn("p:cxnSp"): Connector, |
| 815 | qn("p:grpSp"): GroupShape, |
| 816 | qn("p:sp"): Shape, |
| 817 | qn("p:graphicFrame"): GraphicFrame, |
| 818 | }.get(tag, BaseShape) |
| 819 | |
| 820 | return shape_cls(shape_elm, parent) # pyright: ignore[reportArgumentType] |
| 821 | |
| 822 | |
| 823 | def _LayoutShapeFactory(shape_elm: ShapeElement, parent: ProvidesPart) -> BaseShape: |
searching dependent graphs…