
    2Bf                     F     G d  de       Z G d de      Z G d de      Zy)c                        e Zd ZddZd Zd Zy)BaseNamespaceNc                     |xs d| _         y )N/	namespace)selfr   s     R/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/socketio/namespace.py__init__zBaseNamespace.__init__   s    ")c    c                      y)NF r   s    r	   is_asyncio_basedzBaseNamespace.is_asyncio_based   s    r   c                 D    d|z   }t        | |      r t        | |      | S y)ab  Dispatch an event to the proper handler method.

        In the most common usage, this method is not overloaded by subclasses,
        as it performs the routing of events to methods. However, this
        method can be overridden if special dispatching rules are needed, or if
        having a single method that catches all events is desired.
        on_N)hasattrgetattr)r   eventargshandler_names       r	   trigger_eventzBaseNamespace.trigger_event   s0     u}4&.74.55 'r   N)__name__
__module____qualname__r
   r   r   r   r   r	   r   r      s    *
6r   r   c                        e Zd ZdZd fd	Zd Z	 	 ddZ	 	 ddZddZddZ	ddZ
dd	Zdd
ZddZddZddZ xZS )	Namespacea  Base class for server-side class-based namespaces.

    A class-based namespace is a class that contains all the event handlers
    for a Socket.IO namespace. The event handlers are methods of the class
    with the prefix ``on_``, such as ``on_connect``, ``on_disconnect``,
    ``on_message``, ``on_json``, and so on.

    :param namespace: The Socket.IO namespace to be used with all the event
                      handlers defined in this class. If this argument is
                      omitted, the default namespace is used.
    c                 <    t         t        |   |       d | _        y Nr   )superr   r
   serverr   r   	__class__s     r	   r
   zNamespace.__init__!   s    i')'<r   c                     || _         y r   )r!   )r   r!   s     r	   _set_serverzNamespace._set_server%   	    r   c                 `    | j                   j                  |||||xs | j                  |      S )zEmit a custom event to one or more connected clients.

        The only difference with the :func:`socketio.Server.emit` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        )dataroomskip_sidr   callback)r!   emitr   )r   r   r(   r)   r*   r   r+   s          r	   r,   zNamespace.emit(   s7     {{Dth*3*Et~~)1   3 	3r   c                 ^    | j                   j                  ||||xs | j                  |      S )zSend a message to one or more connected clients.

        The only difference with the :func:`socketio.Server.send` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        )r)   r*   r   r+   )r!   sendr   r   r(   r)   r*   r   r+   s         r	   r.   zNamespace.send4   s5     {{4(*3*Et~~)1   3 	3r   c                 Z    | j                   j                  |||xs | j                        S )zEnter a room.

        The only difference with the :func:`socketio.Server.enter_room` method
        is that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        r   )r!   
enter_roomr   r   sidr)   r   s       r	   r1   zNamespace.enter_room@   2     {{%%c4090KT^^ & M 	Mr   c                 Z    | j                   j                  |||xs | j                        S )zLeave a room.

        The only difference with the :func:`socketio.Server.leave_room` method
        is that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        r   )r!   
leave_roomr   r2   s       r	   r6   zNamespace.leave_roomJ   r4   r   c                 X    | j                   j                  ||xs | j                        S )zClose a room.

        The only difference with the :func:`socketio.Server.close_room` method
        is that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        r   )r!   
close_roomr   )r   r)   r   s      r	   r8   zNamespace.close_roomT   s0     {{%%d090KT^^ & M 	Mr   c                 X    | j                   j                  ||xs | j                        S )zReturn the rooms a client is in.

        The only difference with the :func:`socketio.Server.rooms` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        r   )r!   roomsr   r   r3   r   s      r	   r:   zNamespace.rooms^   s'     {{  	0KT^^ LLr   c                 X    | j                   j                  ||xs | j                        S )zReturn the user session for a client.

        The only difference with the :func:`socketio.Server.get_session`
        method is that when the ``namespace`` argument is not given the
        namespace associated with the class is used.
        r   )r!   get_sessionr   r;   s      r	   r=   zNamespace.get_sessiong   s.     {{&&96 ' 8 	8r   c                 Z    | j                   j                  |||xs | j                        S )zStore the user session for a client.

        The only difference with the :func:`socketio.Server.save_session`
        method is that when the ``namespace`` argument is not given the
        namespace associated with the class is used.
        r   )r!   save_sessionr   )r   r3   sessionr   s       r	   r?   zNamespace.save_sessionq   s2     {{''I$? ( A 	Ar   c                 X    | j                   j                  ||xs | j                        S )a  Return the user session for a client with context manager syntax.

        The only difference with the :func:`socketio.Server.session` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        r   )r!   r@   r   r;   s      r	   r@   zNamespace.session{   s'     {{""3)2Mt~~"NNr   c                 X    | j                   j                  ||xs | j                        S )zDisconnect a client.

        The only difference with the :func:`socketio.Server.disconnect` method
        is that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        r   )r!   
disconnectr   r;   s      r	   rC   zNamespace.disconnect   s0     {{%%c090KT^^ & M 	Mr   r   )NNNNNNNNN)r   r   r   __doc__r
   r%   r,   r.   r1   r6   r8   r:   r=   r?   r@   rC   __classcell__r#   s   @r	   r   r      s^    
 JN
3 >B
3MMMM8AOMr   r   c                   D     e Zd ZdZd fd	Zd ZddZ	 	 d	dZd Z xZ	S )
ClientNamespacea  Base class for client-side class-based namespaces.

    A class-based namespace is a class that contains all the event handlers
    for a Socket.IO namespace. The event handlers are methods of the class
    with the prefix ``on_``, such as ``on_connect``, ``on_disconnect``,
    ``on_message``, ``on_json``, and so on.

    :param namespace: The Socket.IO namespace to be used with all the event
                      handlers defined in this class. If this argument is
                      omitted, the default namespace is used.
    c                 <    t         t        |   |       d | _        y r   )r    rI   r
   clientr"   s     r	   r
   zClientNamespace.__init__   s    ot-	-Br   c                     || _         y r   )rK   )r   rK   s     r	   _set_clientzClientNamespace._set_client   r&   r   c                 \    | j                   j                  |||xs | j                  |      S )zEmit a custom event to the server.

        The only difference with the :func:`socketio.Client.emit` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        )r(   r   r+   )rK   r,   r   )r   r   r(   r   r+   s        r	   r,   zClientNamespace.emit   s3     {{D*3*Et~~)1   3 	3r   c                 Z    | j                   j                  ||xs | j                  |      S )zSend a message to the server.

        The only difference with the :func:`socketio.Client.send` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        )r   r+   )rK   r.   r   r/   s         r	   r.   zClientNamespace.send   s0     {{	0KT^^)1   3 	3r   c                 6    | j                   j                         S )zDisconnect from the server.

        The only difference with the :func:`socketio.Client.disconnect` method
        is that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
        )rK   rC   r   s    r	   rC   zClientNamespace.disconnect   s     {{%%''r   r   )NNNrD   )
r   r   r   rE   r
   rM   r,   r.   rC   rF   rG   s   @r	   rI   rI      s*    
	3 >B	3(r   rI   N)objectr   r   rI   r   r   r	   <module>rR      s.   6F 6(wM wMt0(m 0(r   