Ë
    Fü´jâ	  ã                  ól   — d Z ddlmZ ddlmZ ddlmZ erddlZddlm	Z	 ddl
mZ ddlZ G d„ d	«      Zy)
z Provide the EditableMixin class.é    )Úannotations)ÚTYPE_CHECKING)ÚAPI_PATHN)ÚCallable)ÚSelfc                  óh   — e Zd ZU dZerded<   ded<   ded<   edd„«       Zedd	„«       Zdd
„Z	dd„Z
y)ÚEditableMixinz5Interface for classes that can be edited and deleted.zpraw.RedditÚ_redditz$Callable[[float], datetime.datetime]Ú_to_local_datetimezbool | floatÚeditedc                 ó   — y )N© ©Úselfs    ú`/root/workspace/ytshorts/venv/lib/python3.12/site-packages/praw/models/reddit/mixins/editable.pyÚfullnamezEditableMixin.fullname   s   € Ø#&ó    c                óV   — | j                   du ry| j                  | j                   «      S )zÎThe last edit time as a timezone-aware :class:`datetime.datetime`.

        Returns ``None`` if the object has never been edited. The returned object is
        localized to the system's timezone.

        FN)r   r   r   s    r   Úedited_datetimezEditableMixin.edited_datetime   s(   € ð �;‰;˜%ÑØØ×&Ñ& t§{¡{Ó3Ð3r   c                ód   — | j                   j                  t        d   d| j                  i¬«       y)zøDelete the object.

        Example usage:

        .. code-block:: python

            comment = reddit.comment("dkk4qjd")
            comment.delete()

            submission = reddit.submission("8dmv8z")
            submission.delete()

        ÚdelÚid©ÚdataN)r
   Úpostr   r   r   s    r   ÚdeletezEditableMixin.delete*   s(   € ð 	�‰×Ñœ( 5™/°°t·}±}Ð0EÐÕFr   c                ó  — || j                   ddœ}| j                  j                  t        d   |¬«      d   }dD ]  }||j                  v sŒt        ||«       Œ | j                  j                  |j                  «       | S )a  Replace the body of the object with ``body``.

        :param body: The Markdown formatted content for the updated object.

        :returns: The current instance after updating its attributes.

        Example usage:

        .. code-block:: python

            comment = reddit.comment("dkk4qjd")

            # construct the text of an edited comment
            # by appending to the old body:
            edited_body = comment.body + "Edit: thanks for the gold!"
            comment.edit(edited_body)

        T)ÚtextÚthing_idÚvalidate_on_submitÚeditr   r   )Ú_fetchedr
   Ú_submissionÚrepliesÚ	subreddit)r   r
   r   r   Ú__dict__ÚdelattrÚupdate)r   Úbodyr   ÚupdatedÚ	attributes        r   r!   zEditableMixin.edit:   s‡   € ð( ØŸ™Ø"&ñ
ˆð
 —,‘,×#Ñ#¤H¨VÑ$4¸4Ð#Ó@ÀÑCˆð
ò 	,ˆIð ˜G×,Ñ,Ò,Ü˜ Õ+ð	,ð 	�‰×Ñ˜W×-Ñ-Ô.Øˆr   N)ÚreturnÚstr)r,   zdatetime.datetime | None)r,   ÚNone)r)   r-   r,   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__Úpropertyr   r   r   r!   r   r   r   r	   r	      sE   … Ù?áàÓØ@Ó@ØÓà	Ú&ó 
Ø&àò	4ó ð	4óGô #r   r	   )r2   Ú
__future__r   Útypingr   Ú
praw.constr   ÚdatetimeÚcollections.abcr   Útyping_extensionsr   Úprawr	   r   r   r   ú<module>r<      s,   ðÙ &å "å  å áÛÝ(å&ã÷Kò Kr   