o
    2g+h                     @  s   d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ddl
mZ ddlmZ dd	lmZ dd
lmZ ddl
mZ ddlmZ ddlmZ ddlmZ erPddlZG dd dZG dd deZG dd dZG dd dZG dd dZG dd deeZ dS )zProvide the LiveThread class.    )annotations)TYPE_CHECKINGAnyIterableIterator   )API_PATH)_deprecate_args)cachedproperty   )RedditorList)ListingGenerator)stream_generator   )
RedditBase)FullnameMixin)RedditorNc                   @  s   e Zd ZdZed"ddZd#d	d
Zd$ddZdd Ze	ddddd%ddZ
dd Zd&ddZd&ddZe	ddddd%ddZe	ddddd%d d!ZdS )'LiveContributorRelationshipz<Provide methods to interact with live threads' contributors.permissionsIterable[str]returnstrc                 C  s*   | d u rdhnt | } ddd | D S )Nall,c                 s  s    | ]}d | V  qdS )+N ).0xr   r   O/home/garg/my-data/venv/lib/python3.10/site-packages/praw/models/reddit/live.py	<genexpr>   s    zBLiveContributorRelationship._handle_permissions.<locals>.<genexpr>)setjoinr   r   r   r   _handle_permissions   s   z/LiveContributorRelationship._handle_permissionslist[praw.models.Redditor]c                 C  s8   t d j| jjd}| jj|}t|tr|S |d S )a  Return a :class:`.RedditorList` for live threads' contributors.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            for contributor in thread.contributor():
                print(contributor)

        live_contributorsidr   )r   formatthreadr'   _redditget
isinstancer   )selfurltempr   r   r   __call__   s   z$LiveContributorRelationship.__call__r)   praw.models.LiveThreadc                 C  
   || _ dS )a   Initialize a :class:`.LiveContributorRelationship` instance.

        :param thread: An instance of :class:`.LiveThread`.

        .. note::

            This class should not be initialized directly. Instead, obtain an instance
            via: :meth:`.LiveThread.contributor`.

        Nr)   r-   r)   r   r   r   __init__-   s   
z$LiveContributorRelationship.__init__c                 C  &   t d j| jjd}| jj| dS )zAccept an invite to contribute the live thread.

        Usage:

        .. code-block:: python

            thread = reddit.live("ydwwxneu7vsa")
            thread.contributor.accept_invite()

        live_accept_inviter&   Nr   r(   r)   r'   r*   postr-   r.   r   r   r   accept_invite:      z)LiveContributorRelationship.accept_inviteredditorNr"   str | praw.models.Redditorlist[str] | Nonec                C  @   t d j| jjd}t|d| |d}| jjj||d dS )a  Invite a redditor to be a contributor of the live thread.

        :param redditor: A redditor name or :class:`.Redditor` instance.
        :param permissions: When provided (not ``None``), permissions should be a list
            of strings specifying which subset of permissions to grant. An empty list
            ``[]`` indicates no permissions, and when not provided (``None``), indicates
            full permissions.

        :raises: :class:`.RedditAPIException` if the invitation already exists.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            redditor = reddit.redditor("spez")

            # "manage" and "settings" permissions
            thread.contributor.invite(redditor, permissions=["manage", "settings"])

        .. seealso::

            :meth:`.LiveContributorRelationship.remove_invite` to remove the invite for
            redditor.

        live_inviter&   liveupdate_contributor_invitenametyper   dataNr   r(   r)   r'   r   r#   r*   r9   r-   r=   r   r.   rG   r   r   r   inviteH   s   !z"LiveContributorRelationship.invitec                 C  r6   )zAbdicate the live thread contributor position (use with care).

        Usage:

        .. code-block:: python

            thread = reddit.live("ydwwxneu7vsa")
            thread.contributor.leave()

        
live_leaver&   Nr8   r:   r   r   r   leaveq   r<   z!LiveContributorRelationship.leavec                 C  F   t |tr|jn|}d|i}td j| jjd}| jjj||d dS )a  Remove the redditor from the live thread contributors.

        :param redditor: A redditor fullname (e.g., ``"t2_1w72"``) or :class:`.Redditor`
            instance.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            redditor = reddit.redditor("spez")
            thread.contributor.remove(redditor)
            thread.contributor.remove("t2_1w72")  # with fullname

        r'   live_remove_contribr&   rF   N	r,   r   fullnamer   r(   r)   r'   r*   r9   r-   r=   rP   rG   r.   r   r   r   remove   s   z"LiveContributorRelationship.removec                 C  rM   )aB  Remove the invite for redditor.

        :param redditor: A redditor fullname (e.g., ``"t2_1w72"``) or :class:`.Redditor`
            instance.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            redditor = reddit.redditor("spez")
            thread.contributor.remove_invite(redditor)
            thread.contributor.remove_invite("t2_1w72")  # with fullname

        .. seealso::

            :meth:`.LiveContributorRelationship.invite` to invite a redditor to be a
            contributor of the live thread.

        r'   live_remove_inviter&   rF   NrO   rQ   r   r   r   remove_invite   s   z)LiveContributorRelationship.remove_invitec                C  r@   )a  Update the contributor permissions for ``redditor``.

        :param redditor: A redditor name or :class:`.Redditor` instance.
        :param permissions: When provided (not ``None``), permissions should be a list
            of strings specifying which subset of permissions to grant (other
            permissions are removed). An empty list ``[]`` indicates no permissions, and
            when not provided (``None``), indicates full permissions.

        For example, to grant all permissions to the contributor, try:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            thread.contributor.update("spez")

        To grant ``"access"`` and ``"edit"`` permissions (and to remove other
        permissions), try:

        .. code-block:: python

            thread.contributor.update("spez", permissions=["access", "edit"])

        To remove all permissions from the contributor, try:

        .. code-block:: python

            subreddit.moderator.update("spez", permissions=[])

        live_update_permsr&   liveupdate_contributorrC   rF   NrH   rI   r   r   r   update      $z"LiveContributorRelationship.updatec                C  r@   )a2  Update the contributor invite permissions for ``redditor``.

        :param redditor: A redditor name or :class:`.Redditor` instance.
        :param permissions: When provided (not ``None``), permissions should be a list
            of strings specifying which subset of permissions to grant (other
            permissions are removed). An empty list ``[]`` indicates no permissions, and
            when not provided (``None``), indicates full permissions.

        For example, to set all permissions to the invitation, try:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            thread.contributor.update_invite("spez")

        To set ``"access"`` and ``"edit"`` permissions (and to remove other permissions)
        to the invitation, try:

        .. code-block:: python

            thread.contributor.update_invite("spez", permissions=["access", "edit"])

        To remove all permissions from the invitation, try:

        .. code-block:: python

            thread.contributor.update_invite("spez", permissions=[])

        rU   r&   rB   rC   rF   NrH   rI   r   r   r   update_invite   rX   z)LiveContributorRelationship.update_invite)r   r   r   r   )r   r$   r)   r1   )r=   r>   r   r?   )r=   r>   )__name__
__module____qualname____doc__staticmethodr#   r0   r5   r;   r	   rJ   rL   rR   rT   rW   rY   r   r   r   r   r      s&    

(

+r   c                      s   e Zd ZdZdZed1ddZed2dd	Zed3ddZd4ddZ	d5ddZ
d6ddZ		d7d8 fd d!Z fd"d#Zd$d% Zd9d)d*Zd:d,d-Zd;d/d0Z  ZS )<
LiveThreadaB  An individual :class:`.LiveThread` object.

    .. include:: ../../typical_attributes.rst

    ==================== =========================================================
    Attribute            Description
    ==================== =========================================================
    ``created_utc``      The creation time of the live thread, in `Unix Time`_.
    ``description``      Description of the live thread, as Markdown.
    ``description_html`` Description of the live thread, as HTML.
    ``id``               The ID of the live thread.
    ``nsfw``             A ``bool`` representing whether or not the live thread is
                         marked as NSFW.
    ==================== =========================================================

    .. _unix time: https://en.wikipedia.org/wiki/Unix_time

    r'   r   .praw.models.reddit.live.LiveThreadContributionc                 C     t | S )zProvide an instance of :class:`.LiveThreadContribution`.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            thread.contrib.add("### update")

        )LiveThreadContributionr-   r   r   r   contrib  s   zLiveThread.contrib3praw.models.reddit.live.LiveContributorRelationshipc                 C  rb   )aO  Provide an instance of :class:`.LiveContributorRelationship`.

        You can call the instance to get a list of contributors which is represented as
        :class:`.RedditorList` instance consists of :class:`.Redditor` instances. Those
        :class:`.Redditor` instances have ``permissions`` attributes as contributors:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            for contributor in thread.contributor():
                # prints `Redditor(name="Acidtwist") ["all"]`
                print(contributor, contributor.permissions)

        )r   rd   r   r   r   contributor+  s   zLiveThread.contributor(praw.models.reddit.live.LiveThreadStreamc                 C  rb   )a  Provide an instance of :class:`.LiveThreadStream`.

        Streams are used to indefinitely retrieve new updates made to a live thread,
        like:

        .. code-block:: python

            for live_update in reddit.live("ta535s1hq2je").stream.updates():
                print(live_update.body)

        Updates are yielded oldest first as :class:`.LiveUpdate`. Up to 100 historical
        updates will initially be returned. To only retrieve new updates starting from
        when the stream is created, pass ``skip_existing=True``:

        .. code-block:: python

            live_thread = reddit.live("ta535s1hq2je")
            for live_update in live_thread.stream.updates(skip_existing=True):
                print(live_update.author)

        )LiveThreadStreamrd   r   r   r   stream=  s   zLiveThread.streamotherstr | praw.models.LiveThreadboolc                 C  s2   t |tr|t| kS t || jot| t|kS )zReturn whether the other instance equals the current.

        .. note::

            This comparison is case sensitive.

        )r,   r   	__class__)r-   rk   r   r   r   __eq__V  s   
zLiveThread.__eq__	update_idr   praw.models.LiveUpdatec                 C  s   t | j| j|S )a  Return a lazy :class:`.LiveUpdate` instance.

        :param update_id: A live update ID, e.g.,
            ``"7827987a-c998-11e4-a0b9-22000b6a88d2"``.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            update = thread["7827987a-c998-11e4-a0b9-22000b6a88d2"]
            update.thread  # LiveThread(id="ukaeu1ik4sw5")
            update.id  # "7827987a-c998-11e4-a0b9-22000b6a88d2"
            update.author  # "umbrae"

        )
LiveUpdater*   r'   )r-   rp   r   r   r   __getitem__b  s   zLiveThread.__getitem__intc                 C  s   t | jjt t| A S )z(Return the hash of the current instance.)hashrn   r[   r   rd   r   r   r   __hash__u  s   zLiveThread.__hash__Nredditpraw.Reddit
str | None_datadict[str, Any] | Nonec                   s<   ||f ddkrd}t||r|| _t j||d dS )zInitialize a :class:`.LiveThread` instance.

        :param reddit: An instance of :class:`.Reddit`.
        :param id: A live thread ID, e.g., ``"ukaeu1ik4sw5"``

        Nr   z(Either 'id' or '_data' must be provided.rz   )count	TypeErrorr'   superr5   )r-   rw   r'   rz   msgrn   r   r   r5   y  s   zLiveThread.__init__c                   s>   |   }|d }t| | j|d}| j|j t   d S )NrG   r|   )_fetch_datarE   r*   __dict__rW   r   _fetch)r-   rG   rk   r   r   r   r     s
   zLiveThread._fetchc                 C  s   dd| j id fS )N	liveaboutr'   r&   rd   r   r   r   _fetch_info  s   zLiveThread._fetch_infogenerator_kwargsstr | int | dict[str, str] Iterator[praw.models.Submission]c                 K  s&   t d j| jd}t| j|fi |S )aF  Get submissions linking to the thread.

        :param generator_kwargs: keyword arguments passed to :class:`.ListingGenerator`
            constructor.

        :returns: A :class:`.ListingGenerator` object which yields :class:`.Submission`
            objects.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            for submission in thread.discussions(limit=None):
                print(submission.title)

        live_discussionsr&   )r   r(   r'   r   r*   )r-   r   r.   r   r   r   discussions  s   zLiveThread.discussionsrE   c                 C  s*   t d j| jd}| jj|d|id dS )ac  Report the thread violating the Reddit rules.

        :param type: One of ``"spam"``, ``"vote-manipulation"``,
            ``"personal-information"``, ``"sexualizing-minors"``, or
            ``"site-breaking"``.

        Usage:

        .. code-block:: python

            thread = reddit.live("xyu8kmjvfrww")
            thread.report("spam")

        live_reportr&   rE   rF   N)r   r(   r'   r*   r9   )r-   rE   r.   r   r   r   report  s   zLiveThread.report Iterator[praw.models.LiveUpdate]c                 k  s>    t d j| jd}t| j|fi |D ]}| |_|V  qdS )a  Return a :class:`.ListingGenerator` yields :class:`.LiveUpdate` s.

        :param generator_kwargs: keyword arguments passed to :class:`.ListingGenerator`
            constructor.

        :returns: A :class:`.ListingGenerator` object which yields :class:`.LiveUpdate`
            objects.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            after = "LiveUpdate_fefb3dae-7534-11e6-b259-0ef8c7233633"
            for submission in thread.updates(limit=5, params={"after": after}):
                print(submission.body)

        live_updatesr&   N)r   r(   r'   r   r*   _thread)r-   r   r.   rW   r   r   r   updates  s   zLiveThread.updates)r   ra   )r   rf   )r   rh   )rk   rl   r   rm   )rp   r   r   rq   )r   rt   )NN)rw   rx   r'   ry   rz   r{   )r   r   r   r   )rE   r   )r   r   r   r   )r[   r\   r]   r^   	STR_FIELDr
   re   rg   rj   ro   rs   rv   r5   r   r   r   r   r   __classcell__r   r   r   r   r`     s(    




r`   c                   @  sP   e Zd ZdZdddZddd	Zd
d ZeddddddddddddZdS )rc   zCProvides a set of contribution functions to a :class:`.LiveThread`.r)   r1   c                 C  r2   )a  Initialize a :class:`.LiveThreadContribution` instance.

        :param thread: An instance of :class:`.LiveThread`.

        This instance can be retrieved through ``thread.contrib`` where thread is a
        :class:`.LiveThread` instance. E.g.,

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            thread.contrib.add("### update")

        Nr3   r4   r   r   r   r5     s   
zLiveThreadContribution.__init__bodyr   c                 C  s.   t d j| jjd}| jjj|d|id dS )a  Add an update to the live thread.

        :param body: The Markdown formatted content for the update.

        Usage:

        .. code-block:: python

            thread = reddit.live("ydwwxneu7vsa")
            thread.contrib.add("test `LiveThreadContribution.add()`")

        live_add_updater&   r   rF   Nr8   )r-   r   r.   r   r   r   add  s   zLiveThreadContribution.addc                 C  r6   )zClose the live thread permanently (cannot be undone).

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            thread.contrib.close()

        
live_closer&   Nr8   r:   r   r   r   close  r<   zLiveThreadContribution.closetitledescriptionnsfw	resourcesN)r   r   r   r   ry   bool | Noneother_settingsc          	        s   ||||d}| | tdd | D rdS t| jj| jj  fdd| D }td j	| jjd}| jjj
|| d	 | jj|   dS )
a  Update settings of the live thread.

        :param description: The live thread's description (default: ``None``).
        :param nsfw: Indicate whether this thread is not safe for work (default:
            ``None``).
        :param resources: Markdown formatted information that is useful for the live
            thread (default: ``None``).
        :param title: The title of the live thread (default: ``None``).

        Does nothing if no arguments are provided.

        Each setting will maintain its current value if ``None`` is specified.

        Additional keyword arguments can be provided to handle new settings as Reddit
        introduces them.

        Usage:

        .. code-block:: python

            thread = reddit.live("xyu8kmjvfrww")

            # update 'title' and 'nsfw'
            updated_thread = thread.contrib.update(title=new_title, nsfw=True)

        If Reddit introduces new settings, you must specify ``None`` for the setting you
        want to maintain:

        .. code-block:: python

            # update 'nsfw' and maintain new setting 'foo'
            thread.contrib.update(nsfw=True, foo=None)

        )r   r   r   r   c                 s  s    | ]}|d u V  qd S Nr   )r   valuer   r   r   r   D  s    z0LiveThreadContribution.update.<locals>.<genexpr>Nc                   s(   i | ]\}}||d u rt  |n|qS r   )getattr)r   keyr   r3   r   r   
<dictcomp>H  s    z1LiveThreadContribution.update.<locals>.<dictcomp>live_update_threadr&   rF   )rW   r   valuesr`   r)   r*   r'   itemsr   r(   r9   copy_reset_attributeskeys)	r-   r   r   r   r   r   settingsrG   r.   r   r3   r   rW     s   -

zLiveThreadContribution.updaterZ   )r   r   )
r   ry   r   r   r   ry   r   ry   r   ry   )	r[   r\   r]   r^   r5   r   r   r	   rW   r   r   r   r   rc     s    

rc   c                   @  s$   e Zd ZdZdddZdd
dZdS )ri   zProvides a :class:`.LiveThread` stream.

    Usually used via:

    .. code-block:: python

        for live_update in reddit.live("ta535s1hq2je").stream.updates():
            print(live_update.body)

    live_threadr1   c                 C  r2   )zInitialize a :class:`.LiveThreadStream` instance.

        :param live_thread: The live thread associated with the stream.

        N)r   )r-   r   r   r   r   r5   _  s   
zLiveThreadStream.__init__stream_optionsdict[str, Any]r   r   c                 K  s   t | jjfi |S )a!  Yield new updates to the live thread as they become available.

        :param skip_existing: Set to ``True`` to only fetch items created after the
            stream (default: ``False``).

        As with :meth:`.LiveThread.updates()`, updates are yielded as
        :class:`.LiveUpdate`.

        Updates are yielded oldest first. Up to 100 historical updates will initially be
        returned.

        Keyword arguments are passed to :func:`.stream_generator`.

        For example, to retrieve all new updates made to the ``"ta535s1hq2je"`` live
        thread, try:

        .. code-block:: python

            for live_update in reddit.live("ta535s1hq2je").stream.updates():
                print(live_update.body)

        To only retrieve new updates starting from when the stream is created, pass
        ``skip_existing=True``:

        .. code-block:: python

            live_thread = reddit.live("ta535s1hq2je")
            for live_update in live_thread.stream.updates(skip_existing=True):
                print(live_update.author)

        )r   r   r   )r-   r   r   r   r   r   g  s   "zLiveThreadStream.updatesN)r   r1   )r   r   r   r   )r[   r\   r]   r^   r5   r   r   r   r   r   ri   S  s    
ri   c                   @  s*   e Zd ZdZdddZdd Zdd	 Zd
S )LiveUpdateContributionzAProvides a set of contribution functions to :class:`.LiveUpdate`.rW   rq   c                 C  r2   )a  Initialize a :class:`.LiveUpdateContribution` instance.

        :param update: An instance of :class:`.LiveUpdate`.

        This instance can be retrieved through ``update.contrib`` where update is a
        :class:`.LiveUpdate` instance. E.g.,

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            update = thread["7827987a-c998-11e4-a0b9-22000b6a88d2"]
            update.contrib  # LiveUpdateContribution instance
            update.contrib.remove()

        N)rW   )r-   rW   r   r   r   r5     s   
zLiveUpdateContribution.__init__c                 C  :   t d j| jjjd}d| jji}| jjjj||d dS )zRemove a live update.

        Usage:

        .. code-block:: python

            thread = reddit.live("ydwwxneu7vsa")
            update = thread["6854605a-efec-11e6-b0c7-0eafac4ff094"]
            update.contrib.remove()

        live_remove_updater&   r'   rF   Nr   r(   rW   r)   r'   rP   r*   r9   r-   r.   rG   r   r   r   rR     s   zLiveUpdateContribution.removec                 C  r   )a  Strike a content of a live update.

        .. code-block:: python

            thread = reddit.live("xyu8kmjvfrww")
            update = thread["cb5fe532-dbee-11e6-9a91-0e6d74fabcc4"]
            update.contrib.strike()

        To check whether the update is stricken or not, use ``update.stricken``
        attribute.

        .. note::

            Accessing lazy attributes on updates (includes ``update.stricken``) may
            raise :py:class:`AttributeError`. See :class:`.LiveUpdate` for details.

        live_striker&   r'   rF   Nr   r   r   r   r   strike  s   zLiveUpdateContribution.strikeN)rW   rq   )r[   r\   r]   r^   r5   rR   r   r   r   r   r   r     s
    
r   c                      sh   e Zd ZdZdZd ZedddZeddd	Z		
	
	
dd fddZ
d  fddZ fddZ  ZS )!rr   a.  An individual :class:`.LiveUpdate` object.

    .. include:: ../../typical_attributes.rst

    =============== ===================================================================
    Attribute       Description
    =============== ===================================================================
    ``author``      The :class:`.Redditor` who made the update.
    ``body``        Body of the update, as Markdown.
    ``body_html``   Body of the update, as HTML.
    ``created_utc`` The time the update was created, as `Unix Time`_.
    ``stricken``    A ``bool`` representing whether or not the update was stricken (see
                    :meth:`.strike`).
    =============== ===================================================================

    .. _unix time: https://en.wikipedia.org/wiki/Unix_time

    r'   r   .praw.models.reddit.live.LiveUpdateContributionc                 C  rb   )a&  Provide an instance of :class:`.LiveUpdateContribution`.

        Usage:

        .. code-block:: python

            thread = reddit.live("ukaeu1ik4sw5")
            update = thread["7827987a-c998-11e4-a0b9-22000b6a88d2"]
            update.contrib  # LiveUpdateContribution instance

        )r   rd   r   r   r   re     s   zLiveUpdate.contribr`   c                 C  s   | j S )z@Return :class:`.LiveThread` object the update object belongs to.)r   rd   r   r   r   r)     s   zLiveUpdate.threadNrw   rx   	thread_idry   rp   rz   r{   c                   sZ   |durt  j||dd dS |r'|r'|| _t  j|dd t| j|| _dS d}t|)a  Initialize a :class:`.LiveUpdate` instance.

        Either ``thread_id`` and ``update_id``, or ``_data`` must be provided.

        :param reddit: An instance of :class:`.Reddit`.
        :param thread_id: A live thread ID, e.g., ``"ukaeu1ik4sw5"``.
        :param update_id: A live update ID, e.g.,
            ``"7827987a-c998-11e4-a0b9-22000b6a88d2"``.

        Usage:

        .. code-block:: python

            update = LiveUpdate(reddit, "ukaeu1ik4sw5", "7827987a-c998-11e4-a0b9-22000b6a88d2")
            update.thread  # LiveThread(id="ukaeu1ik4sw5")
            update.id  # "7827987a-c998-11e4-a0b9-22000b6a88d2"
            update.author  # "umbrae"

        NT)rz   _fetchedr|   z@Either 'thread_id' and 'update_id', or '_data' must be provided.)r   r5   r'   r`   r*   r   r~   )r-   rw   r   rp   rz   r   r   r   r   r5     s   zLiveUpdate.__init__	attributer   r   r   c                   s(   |dkrt | j|d}t || dS )zObjectify author.author)rD   N)r   r*   r   __setattr__)r-   r   r   r   r   r   r     s   zLiveUpdate.__setattr__c                   sD   t d j| jj| jd}| j|d }| j|j t 	  d S )N
live_focus)r   rp   r   )
r   r(   r)   r'   r*   r+   r   rW   r   r   )r-   r.   rk   r   r   r   r      s   zLiveUpdate._fetch)r   r   )r   r`   )NNN)rw   rx   r   ry   rp   ry   rz   r{   )r   r   r   r   )r[   r\   r]   r^   r   _kindr
   re   propertyr)   r5   r   r   r   r   r   r   r   rr     s    'rr   )!r^   
__future__r   typingr   r   r   r   constr   utilr	   
util.cacher
   list.redditorr   listing.generatorr   r   baser   mixinsr   r=   r   praw.modelsprawr   r`   rc   ri   r   rr   r   r   r   r   <module>   s,     s Zs9<