Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEP: Remove remaining XMP deprecations for version 4 #2386

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 1 addition & 40 deletions pypdf/xmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
from xml.dom.minidom import Element as XmlElement
from xml.parsers.expat import ExpatError

from ._utils import (
StreamType,
deprecate_no_replacement,
deprecate_with_replacement,
)
from ._utils import StreamType, deprecate_no_replacement
from .errors import PdfReadError
from .generic import ContentStream, PdfObject

Expand Down Expand Up @@ -225,11 +221,6 @@ def __init__(self, stream: ContentStream) -> None:
)[0]
self.cache: Dict[Any, Any] = {}

@property
def rdfRoot(self) -> XmlElement: # deprecated
deprecate_with_replacement("rdfRoot", "rdf_root", "4.0.0")
return self.rdf_root

def write_to_stream(
self, stream: StreamType, encryption_key: Union[None, str, bytes] = None
) -> None:
Expand Down Expand Up @@ -342,16 +333,6 @@ def _get_text(self, element: XmlElement) -> str:
The date and time are returned as a UTC datetime.datetime object.
"""

@property
def xmp_createDate(self) -> datetime.datetime: # deprecated
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: # deprecated
deprecate_with_replacement("xmp_createDate", "xmp_create_date", "4.0.0")
self.xmp_create_date = value

xmp_modify_date = property(
_getter_single(XMP_NAMESPACE, "ModifyDate", _converter_date)
)
Expand All @@ -361,16 +342,6 @@ def xmp_createDate(self, value: datetime.datetime) -> None: # deprecated
The date and time are returned as a UTC datetime.datetime object.
"""

@property
def xmp_modifyDate(self) -> datetime.datetime: # deprecated
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: # deprecated
deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date", "4.0.0")
self.xmp_modify_date = value

xmp_metadata_date = property(
_getter_single(XMP_NAMESPACE, "MetadataDate", _converter_date)
)
Expand All @@ -380,16 +351,6 @@ def xmp_modifyDate(self, value: datetime.datetime) -> None: # deprecated
The date and time are returned as a UTC datetime.datetime object.
"""

@property
def xmp_metadataDate(self) -> datetime.datetime: # deprecated
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: # deprecated
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"))
"""The name of the first known tool used to create the resource."""

Expand Down
Loading