From 97756d5010e1166629836a9bd8546e14b1f8ced4 Mon Sep 17 00:00:00 2001 From: j-t-1 <120829237+j-t-1@users.noreply.github.com> Date: Tue, 28 May 2024 10:11:56 +0100 Subject: [PATCH] STY: Change interiour_color to interior_color in classes Ellipse and Rectangle Also improve slightly docstrings and documentation --- pypdf/annotations/_markup_annotations.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pypdf/annotations/_markup_annotations.py b/pypdf/annotations/_markup_annotations.py index b953900c7..af81a6ed1 100644 --- a/pypdf/annotations/_markup_annotations.py +++ b/pypdf/annotations/_markup_annotations.py @@ -209,7 +209,7 @@ def __init__( self, rect: Union[RectangleObject, Tuple[float, float, float, float]], *, - interiour_color: Optional[str] = None, + interior_color: Optional[str] = None, **kwargs: Any, ): super().__init__(**kwargs) @@ -221,7 +221,11 @@ def __init__( } ) - if interiour_color: + if kwargs.get("interiour_color"): + interior_color = kwargs["interiour_color"] + deprecate_with_replacement("interiour_color", "interior_color", "6.0.0") + + if interior_color: self[NameObject("/IC")] = ArrayObject( [FloatObject(n) for n in hex_to_rgb(interiour_color)] ) @@ -257,7 +261,7 @@ def __init__( self, rect: Union[RectangleObject, Tuple[float, float, float, float]], *, - interiour_color: Optional[str] = None, + interior_color: Optional[str] = None, **kwargs: Any, ): super().__init__(**kwargs) @@ -269,7 +273,11 @@ def __init__( } ) - if interiour_color: + if kwargs.get("interiour_color"): + interior_color = kwargs["interiour_color"] + deprecate_with_replacement("interiour_color", "interior_color", "6.0.0") + + if interior_color: self[NameObject("/IC")] = ArrayObject( [FloatObject(n) for n in hex_to_rgb(interiour_color)] )