U
    
W[                     @   s   d Z ddlmZmZ ddlZddlmZ ddlmZ ej	
 dkr`ej	 s`ejds`edG d	d
 d
ejZG dd dejZdd ZdgZdS )a  
This module provides support for Twisted to interact with the gtk3 mainloop
via Gobject introspection. This is like gi, but slightly slower and requires a
working $DISPLAY.

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

    from twisted.internet import gtk3reactor
    gtk3reactor.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.
    )divisionabsolute_importN)	gireactor)runtimeposixZDISPLAYz=Gtk3 requires X11, and no DISPLAY environment variable is setc                   @   s   e Zd ZdZdd ZdS )Gtk3Reactorz/
    A reactor using the gtk3+ event loop.
    c                 C   s   t jj| dd dS z:
        Override init to set the C{useGtk} flag.
        T)ZuseGtkN)r   	GIReactor__init__self r   >/usr/lib/python3/dist-packages/twisted/internet/gtk3reactor.pyr
   .   s    zGtk3Reactor.__init__N__name__
__module____qualname____doc__r
   r   r   r   r   r   )   s   r   c                   @   s   e Zd ZdZdd ZdS )PortableGtk3Reactorz$
    Portable GTK+ 3.x reactor.
    c                 C   s   t jj| dd dS r   )r   PortableGIReactorr
   r   r   r   r   r
   :   s    zPortableGtk3Reactor.__init__Nr   r   r   r   r   r   6   s   r   c                  C   s4   t j dkrt } nt } ddlm} ||  | S )zM
    Configure the Twisted mainloop to be run inside the gtk3+ mainloop.
    r   r   )installReactor)r   platformgetTyper   r   Ztwisted.internet.mainr   )Zreactorr   r   r   r   installB   s    r   )r   Z
__future__r   r   osZtwisted.internetr   Ztwisted.pythonr   r   r   ZisMacOSXenvirongetImportErrorr	   r   r   r   r   __all__r   r   r   r   <module>   s    
