3
$ßL]Â  ã               @   sj   d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ eje	ƒZ
dd„ Zejdƒd	dd„ƒZdS )
é    N)Úcbook)Ú_Backendc              C   s  t jjdƒpt jjdƒ} | r*| jjƒ r*dS t jjdƒp@t jjdƒ}|rT|jjƒ rTdS t jjdƒ}|rp|jƒ rpdS t jjd	ƒ}|rŒ|jƒ rŒd	S t jjd
ƒ}|rÔx6t jƒ jƒ D ]&}x |rÎ|j	|j
jkrÆdS |j}q°W qªW dt jkrðt jd jƒ rðdS t jjdƒ�rtjjdƒ �rdS dS )a/  
    Return the interactive framework whose event loop is currently running, if
    any, or "headless" if no event loop can be started, or None.

    Returns
    -------
    Optional[str]
        One of the following values: "qt5", "qt4", "gtk3", "wx", "tk",
        "macosx", "headless", ``None``.
    zPyQt5.QtWidgetszPySide2.QtWidgetsZqt5zPyQt4.QtGuizPySide.QtGuiZqt4zgi.repository.GtkZgtk3ÚwxÚtkinterZtkzmatplotlib.backends._macosxÚmacosxÚlinuxZDISPLAYZheadlessN)ÚsysÚmodulesÚgetZQApplicationÚinstanceZ
main_levelZGetAppÚ_current_framesÚvaluesÚf_codeZmainloopÚ__code__Úf_backZevent_loop_is_runningÚplatformÚ
startswithÚosÚenviron)Z	QtWidgetsZQtGuiZGtkr   r   Úframe© r   úD/tmp/pip-install-edjban26/matplotlib/matplotlib/backends/__init__.pyÚ"_get_running_interactive_framework   s6    
r   z3.0c             C   sv   | dkrt jƒ } | jdƒr&| dd… ndj| jƒ ƒ}tj|ƒ}tdtft	|ƒƒ}| a
tjd| |jƒ ||j|j|jfS )a  
    Return new_figure_manager, draw_if_interactive and show for pyplot.

    This provides the backend-specific functions that are used by pyplot to
    abstract away the difference between backends.

    Parameters
    ----------
    name : str, optional
        The name of the backend to use.  If `None`, falls back to
        ``matplotlib.get_backend()`` (which return :rc:`backend`).

    Returns
    -------
    backend_mod : module
        The module which contains the backend of choice

    new_figure_manager : function
        Create a new figure manager (roughly maps to GUI window)

    draw_if_interactive : function
        Redraw the current figure if pyplot is interactive

    show : function
        Show (and possibly block) any unshown figures.
    Nz	module://é	   zmatplotlib.backends.backend_{}ÚBackendzbackend %s version %s)Ú
matplotlibÚget_backendr   ÚformatÚlowerÚ	importlibÚimport_moduleÚtyper   ÚvarsÚbackendÚ_logÚdebugZbackend_versionZnew_figure_managerZdraw_if_interactiveÚshow)ÚnameZbackend_nameZbackend_modr   r   r   r   Úpylab_setup9   s    
r(   )N)r   Úloggingr   r   r   r   Zmatplotlib.backend_basesr   Ú	getLoggerÚ__name__r$   r   Ú
deprecatedr(   r   r   r   r   Ú<module>   s   
(