Ë
    Fü´j¥  ã                  ó‚   — d Z ddlmZ ddlmZ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mZ  G d
„ de	«      Zy)zProvide the MoreComments class.é    )Úannotations)ÚTYPE_CHECKINGÚAny)ÚAPI_PATH)ÚPRAWBaseN)Úmodels)ÚCommentForest)Ú
Submissionc                  ó²   ‡ — e Zd ZU dZdZded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   dˆ fd„Zdd„Zdˆ fd„Zdd„Z	dd„Z
dd„Zd d„Zddœdd„Zˆ xZS )!ÚMoreCommentsz+A class indicating there are more comments.é   z:CommentForest | list[models.Comment | MoreComments] | NoneÚ	_commentsz#list[models.Comment | MoreComments]Ú_remove_fromz	list[str]ÚchildrenÚintÚcountÚstrÚnameÚ	parent_idr
   Ú
submissionc                ó¶   •— t        || j                  «      r4| j                  |j                  k(  xr | j                  |j                  k(  S t        ‰| �  |«      S )zGReturn ``True`` if these :class:`.MoreComments` instances are the same.)Ú
isinstanceÚ	__class__r   r   ÚsuperÚ__eq__)ÚselfÚotherr   s     €úU/root/workspace/ytshorts/venv/lib/python3.12/site-packages/praw/models/reddit/more.pyr   zMoreComments.__eq__   sE   ø€ ä�e˜TŸ^™^Ô,Ø—:‘: §¡Ñ,ÒP°·±À%Ç.Á.Ñ1PÐPÜ‰w‰~˜eÓ$Ð$ó    c                ój   — t        | j                  j                  «      t        t        | «      «      z  S )z(Return the hash of the current instance.)Úhashr   Ú__name__r   )r   s    r   Ú__hash__zMoreComments.__hash__%   s$   € ä�D—N‘N×+Ñ+Ó,¬t´C¸³I«Ñ>Ð>r   c                ó6   •— t         ‰| �  ||¬«       d| _        y)z-Initialize a :class:`.MoreComments` instance.)Ú_dataN)r   Ú__init__r   )r   Úredditr%   r   s      €r   r&   zMoreComments.__init__)   s   ø€ ô
 	‰Ñ˜ uÐÔ-Øˆ�r   c                ó4   — | j                   |j                   kD  S )z:Provide a sort order on the :class:`.MoreComments` object.)r   )r   r   s     r   Ú__lt__zMoreComments.__lt__1   s   € ð
 �z‰z˜EŸK™KÑ'Ð'r   c                óÖ   — | j                   d| j                   }t        | j                   «      | j                  kD  rd|d<   d| j                  j                  › d| j
                  › d|›d�S )z?Return an object initialization representation of the instance.Nz...éÿÿÿÿú<z count=z, children=ú>)r   ÚMAX_COMMENTS_IN_REPRÚlenr   r"   r   )r   r   s     r   Ú__repr__zMoreComments.__repr__8   sd   € à—=‘=Ð!< 4×#<Ñ#<Ð=ˆÜˆt�}‰}Ó × 9Ñ 9Ò9Ø ˆH�R‰LØ�4—>‘>×*Ñ*Ð+¨7°4·:±:°,¸kÈ(ÈÐUVÐWÐWr   c               ó  — | j                   rJ d«       ‚| j                  | j                  j                  dd«      d   «      }|j                  | _        |r"| j
                  D ]  }| j                  |_        Œ | j
                  S )Nú#Please file a bug report with PRAW.Ú_é   )r   Ú_load_commentr   ÚsplitÚrepliesr   r   )r   ÚupdateÚparentÚcomments       r   Ú_continue_commentszMoreComments._continue_comments?   sr   € Ø—=’=ÐGÐ"GÓGÐ Ø×#Ñ# D§N¡N×$8Ñ$8¸¸aÓ$@ÀÑ$CÓDˆØŸ™ˆŒÙØŸ>™>ò 5�Ø%)§_¡_�Õ"ð5à�~‰~Ðr   c                óX  — t         d   j                  | j                  j                  ¬«      › d|› �}| j                  j                  || j                  j                  | j                  j                  dœ¬«      \  }}t        |j                  «      dk(  sJ d«       ‚|j                  d   S )	Nr   )Úidz_/)ÚlimitÚsort)Úparamsr4   r2   r   )
r   Úformatr   r=   Ú_redditÚgetÚcomment_limitÚcomment_sortr/   r   )r   Ú
comment_idÚpathr3   Úcommentss        r   r5   zMoreComments._load_commentH   s¡   € Ü˜<Ñ(×/Ñ/°4·?±?×3EÑ3EÐ/ÓFÐGÀrÈ*ÈÐVˆØ—l‘l×&Ñ&ØàŸ™×6Ñ6ØŸ™×4Ñ4ñð 'ó 
‰ˆˆ8ô �8×$Ñ$Ó%¨Ò*ÐQÐ,QÓQÐ*Ø× Ñ  Ñ#Ð#r   T©r8   c               ó²  — | j                   €À| j                  dk(  r| j                  |¬«      S | j                  sJ d«       ‚dj	                  | j                  «      | j
                  j                  | j
                  j                  dœ}| j                  j                  t        d   |¬«      }|| _         |r|D ]  }| j
                  |_        Œ | j                   S )zIFetch and return the comments for a single :class:`.MoreComments` object.r   rI   r2   ú,)r   Úlink_idr?   Úmorechildren)Údata)r   r   r;   r   Újoinr   ÚfullnamerE   rB   Úpostr   )r   r8   rN   rH   r:   s        r   rH   zMoreComments.commentsT   sÀ   € à�>‰>Ð!Ø�z‰z˜QŠØ×.Ñ.°fÐ.Ó=Ð=Ø—=’=ÐGÐ"GÓG�=àŸH™H T§]¡]Ó3ØŸ?™?×3Ñ3ØŸ™×4Ñ4ñˆDð
 =A¿L¹L×<MÑ<MÌhÐWeÑNfÐmqÐ<MÓ<rˆHØ%ˆDŒNÙØ'ò 9�GØ)-¯©�GÕ&ð9à�~‰~Ðr   )r   ÚobjectÚreturnÚbool)rS   r   )r'   zpraw.Redditr%   zdict[str, Any]rS   ÚNone)r   r   rS   rT   )rS   r   )r8   rT   rS   z3CommentForest | list[models.Comment | MoreComments])rF   r   rS   zmodels.Comment)r"   Ú
__module__Ú__qualname__Ú__doc__r.   Ú__annotations__r   r#   r&   r)   r0   r;   r5   rH   Ú__classcell__)r   s   @r   r   r      sf   ø… Ù5àÐàIÓIà5Ó5ØÓØƒJØ
ƒIØƒNØÓõ%ó?õó(óXóó
$ð *.÷ ñ r   r   )rX   Ú
__future__r   Útypingr   r   Ú
praw.constr   Úpraw.models.baser   Úprawr   Úpraw.models.comment_forestr	   Úpraw.models.reddit.submissionr
   r   © r   r   ú<module>rc      s1   ðÙ %å "ç %å Ý %áÛÝÝ8Ý8ôS�8õ Sr   