� ���g%��^�ddlmZGd�dej��ZGd�dej��ZdS)�)�base_namespacec�t�eZdZdZd�Z dd�Z dd�Z dd�Zdd�Zdd �Z dd �Z dd �Z dd �Z dd �Z dd�ZdS)� NamespaceaBase 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���d|pdz}t||��rF t||��|�S#t$r%|dkrt||��|dd��cYS�wxYwdS�abDispatch 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_�� disconnectN�������hasattr�getattr� TypeError��self�event�args� handler_names �b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/socketio/namespace.py� trigger_eventzNamespace.trigger_event����� ��,� � �4�� &� &� � �2�w�t�\�2�2�D�9�9��� � � ��L�(�(�6�7�4��6�6��S�b�S� �B�B�B�B��  ���� � ��,�+A�ANFc �T�|j�||||||p|j||���S)z�Emit 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�to�room�skip_sid� namespace�callback� ignore_queue)�server�emitr) rrrrrrrrr s rr"zNamespace.emit#s@���{����D�R�d�)1�*3�*E�t�~�)1� � �N�N� N�c �R�|j�|||||p|j||���S)z�Send 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. )rrrrrr )r!�sendr)rrrrrrrr s rr%zNamespace.send0s=���{�����$��*3�*E�t�~�)1� � �N�N� Nr#c �R�|j�|||||p|j||���S)aEmit a custom event to a client and wait for the response. The only difference with the :func:`socketio.Server.call` method is that when the ``namespace`` argument is not given the namespace associated with the class is used. )rr�sidr�timeoutr )r!�callr)rrrrr'rr(r s rr)zNamespace.call<s=���{����D�R�S�*3�*E�t�~�(/�l� �L�L� Lr#c�J�|j�|||p|j���S)z�Enter 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�rr'rrs rr,zNamespace.enter_roomH�4���{�%�%�c�4�09�0K�T�^�&�M�M� Mr#c�J�|j�|||p|j���S)z�Leave 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_roomrr-s rr0zNamespace.leave_roomRr.r#c�H�|j�||p|j���S)z�Close 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)rrrs rr2zNamespace.close_room\s2���{�%�%�d�09�0K�T�^�&�M�M� Mr#c�H�|j�||p|j���S)z�Return 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�rr'rs rr4zNamespace.get_sessionfs/���{�&�&� �9�6���'�8�8� 8r#c�J�|j�|||p|j���S)z�Store 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)rr'�sessionrs rr7zNamespace.save_sessionps4���{�'�'� ��I�$?���(�A�A� Ar#c�H�|j�||p|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!r8rr5s rr8zNamespace.sessionzs&���{�"�"�3�)�2M�t�~�"�N�N�Nr#c�H�|j�||p|j���S)z�Disconnect 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!r rr5s rr zNamespace.disconnect�s2���{�%�%�c�09�0K�T�^�&�M�M� Mr#)NNNNNNF)NNNNNF)N)�__name__� __module__� __qualname__�__doc__rr"r%r)r,r0r2r4r7r8r �r#rrrs9������ � ����&CG�9>� N� N� N� N�GK�).� N� N� N� N�CG�(-� L� L� L� L�M�M�M�M�M�M�M�M�M�M�M�M�8�8�8�8�A�A�A�A�O�O�O�O�M�M�M�M�M�Mr#rc�6�eZdZdZd�Zdd�Zdd�Zdd�Zd�ZdS) �ClientNamespaceaBase 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���d|pdz}t||��rF t||��|�S#t$r%|dkrt||��|dd��cYS�wxYwdSrr rs rrzClientNamespace.trigger_event�rrNc�L�|j�|||p|j|���S)z�Emit 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. )rrr)�clientr"r)rrrrrs rr"zClientNamespace.emit�s4���{����D�*3�*E�t�~�)1� �3�3� 3r#c�J�|j�||p|j|���S)z�Send 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. )rr)rDr%r)rrrrrs rr%zClientNamespace.send�s1���{���� �0K�T�^�)1� �3�3� 3r#c�L�|j�|||p|j|���S)aEmit a custom event to the server and wait for the response. The only difference with the :func:`socketio.Client.call` method is that when the ``namespace`` argument is not given the namespace associated with the class is used. )rrr()rDr)r)rrrrr(s rr)zClientNamespace.call�s4���{����D�*3�*E�t�~�(/� �1�1� 1r#c�4�|j���S)z�Disconnect 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. )rDr )rs rr zClientNamespace.disconnect�s���{�%�%�'�'�'r#)NNN) r;r<r=r>rr"r%r)r r?r#rrArA�sx������ � ����& 3� 3� 3� 3�3�3�3�3� 1� 1� 1� 1�(�(�(�(�(r#rAN)r r�BaseServerNamespacer�BaseClientNamespacerAr?r#r�<module>rJs���������GM�GM�GM�GM�GM��2�GM�GM�GM�TF(�F(�F(�F(�F(�n�8�F(�F(�F(�F(�F(r#
Memory