From 1ab1b3e9de94290af0b8cd2e4f5294402faf224e Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Sun, 19 Jun 2022 09:19:18 +0200 Subject: [PATCH] Add when it will be deprecated --- PyPDF2/generic.py | 6 ++++-- PyPDF2/xmp.py | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/PyPDF2/generic.py b/PyPDF2/generic.py index 2ca0ab472..8767ec5e3 100644 --- a/PyPDF2/generic.py +++ b/PyPDF2/generic.py @@ -395,7 +395,9 @@ def readStringFromStream( stream: StreamType, forced_encoding: Union[None, str, List[str], Dict[int, str]] = None, ) -> Union["TextStringObject", "ByteStringObject"]: # pragma: no cover - deprecate_with_replacement("readStringFromStream", "read_string_from_stream") + deprecate_with_replacement( + "readStringFromStream", "read_string_from_stream", "4.0.0" + ) return read_string_from_stream(stream, forced_encoding) @@ -838,7 +840,7 @@ def __init__(self) -> None: DictionaryObject.__init__(self) def hasChildren(self) -> bool: # pragma: no cover - deprecate_with_replacement("hasChildren", "has_children") + deprecate_with_replacement("hasChildren", "has_children", "4.0.0") return self.has_children() def has_children(self) -> bool: diff --git a/PyPDF2/xmp.py b/PyPDF2/xmp.py index 95fc82913..cbfd514e9 100644 --- a/PyPDF2/xmp.py +++ b/PyPDF2/xmp.py @@ -385,12 +385,12 @@ def _get_text(self, element: XmlElement) -> str: @property def xmp_createDate(self) -> datetime.datetime: # pragma: no cover - deprecate_with_replacement("xmp_createDate", "xmp_create_date") + deprecate_with_replacement("xmp_createDate", "xmp_create_date", "4.0.0") return self.xmp_create_date @xmp_createDate.setter def xmp_createDate(self, value: datetime.datetime) -> None: # pragma: no cover - deprecate_with_replacement("xmp_createDate", "xmp_create_date") + deprecate_with_replacement("xmp_createDate", "xmp_create_date", "4.0.0") self.xmp_create_date = value xmp_modify_date = property( @@ -403,12 +403,12 @@ def xmp_createDate(self, value: datetime.datetime) -> None: # pragma: no cover @property def xmp_modifyDate(self) -> datetime.datetime: # pragma: no cover - deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date") + deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date", "4.0.0") return self.xmp_modify_date @xmp_modifyDate.setter def xmp_modifyDate(self, value: datetime.datetime) -> None: # pragma: no cover - deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date") + deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date", "4.0.0") self.xmp_modify_date = value xmp_metadata_date = property( @@ -422,12 +422,12 @@ def xmp_modifyDate(self, value: datetime.datetime) -> None: # pragma: no cover @property def xmp_metadataDate(self) -> datetime.datetime: # pragma: no cover - deprecate_with_replacement("xmp_metadataDate", "xmp_metadata_date") + deprecate_with_replacement("xmp_metadataDate", "xmp_metadata_date", "4.0.0") return self.xmp_metadata_date @xmp_metadataDate.setter def xmp_metadataDate(self, value: datetime.datetime) -> None: # pragma: no cover - deprecate_with_replacement("xmp_metadataDate", "xmp_metadata_date") + deprecate_with_replacement("xmp_metadataDate", "xmp_metadata_date", "4.0.0") self.xmp_metadata_date = value xmp_creator_tool = property(_getter_single(XMP_NAMESPACE, "CreatorTool"))