File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 77from tppt .pptx .presentation import PptxConvertible
88from tppt .types ._length import Length
99
10- from . import BaseShape
10+ from . import Shape
1111
1212
13- class SlidePlaceholder (BaseShape [PptxSlidePlaceholder ]):
13+ class SlidePlaceholder (Shape [PptxSlidePlaceholder ]):
1414 def __init__ (self , pptx_obj : PptxSlidePlaceholder ) -> None :
1515 self ._pptx = pptx_obj
1616
Original file line number Diff line number Diff line change 1+ import datetime
12from typing import (
23 TYPE_CHECKING ,
34 Annotated ,
1415 overload ,
1516)
1617
18+ from tppt .exception import InvalidSetterTypeError
19+
1720if TYPE_CHECKING :
1821 from ..pptx .slide import SlideBuilder
1922 from ..pptx .slide_layout import SlideLayout as PptxConvertibleSlideLayout
@@ -152,6 +155,16 @@ def placeholder_registry(slide: Slide):
152155 for placeholder , value in zip (
153156 slide .placeholders , get_placeholders (self ._slide_layout ).values ()
154157 ):
158+ match value :
159+ case None :
160+ continue
161+ case str ():
162+ pass
163+ case datetime .date ():
164+ value = value .strftime ("%Y%m/%d" )
165+ case _:
166+ raise InvalidSetterTypeError (str , type (value ))
167+
155168 placeholder .text = value
156169
157170 return SlideBuilder (
You can’t perform that action at this time.
0 commit comments