a
    lcG                     @   s\   d Z ddlmZ ddlmZmZmZmZmZm	Z	 dd Z
G dd deZG dd	 d	eZd
S )zoConfigurable for configuring the IPython inline backend

This module does not import anything from matplotlib.
    )SingletonConfigurable)DictInstanceSetBool
TraitErrorUnicodec                  C   s0   d} zddl m} d} W n ty*   Y n0 | S )zTest if PIL/Pillow is availableFr   )ImageT)ZPILr	   ImportError)outr	    r   T/var/www/html/django/DPS/env/lib/python3.9/site-packages/matplotlib_inline/config.pypil_available   s    r   c                   @   s   e Zd ZdS )InlineBackendConfigN)__name__
__module____qualname__r   r   r   r   r      s   r   c                   @   s   e Zd ZdZei ddjddZedhddjddZdd	 Z	d
d Z
eddjddZdd ZeddiddjddZe	ZedddjddZedddZdS )InlineBackendz7An object to store configuration of the inline backend.a  Dict to manage matplotlib configuration defaults in the inline
        backend. As of v0.1.4 IPython/Jupyter do not override defaults out of
        the box, but third-party tools may use it to manage rc data. To change
        personal defaults for matplotlib,  use matplotlib's configuration
        tools, or customize this class in your `ipython_config.py` file for
        IPython/Jupyter-specific usage.)helpT)configZpngzYA set of figure formats to enable: 'png',
                'retina', 'jpeg', 'svg', 'pdf'.c                 C   s2   | j d ur.ddlm} || j | jfi | j d S )Nr   )select_figure_formats)shellZIPython.core.pylabtoolsr   figure_formatsprint_figure_kwargs)selfr   r   r   r   _update_figure_formatters6   s    
z'InlineBackend._update_figure_formattersc                 C   s*   d|v sd|v rt  std|   d S )NZjpgZjpegz#Requires PIL/Pillow for JPG figures)r   r   r   r   nameoldnewr   r   r   _figure_formats_changed;   s    z%InlineBackend._figure_formats_changedznThe figure format to enable (deprecated
                                         use `figure_formats` instead)c                 C   s   |r|h| _ d S )N)r   r   r   r   r   _figure_format_changedD   s    z$InlineBackend._figure_format_changedZbbox_inchesZtightzExtra kwargs to be passed to fig.canvas.print_figure.

        Logical examples include: bbox_inches, quality (for jpeg figures), etc.
        aE  Close all figures at the end of each cell.

        When True, ensures that each cell starts with no active figures, but it
        also means that one must keep track of references in order to edit or
        redraw figures in subsequent cells. This mode is ideal for the notebook,
        where residual plots from other cells might be surprising.

        When False, one must call figure() to create new figures. This means
        that gcf() and getfigs() can reference figures created in other cells,
        and the active figure can continue to be edited with pylab/pyplot
        methods that reference the current active figure. This mode facilitates
        iterative editing of figures, and behaves most consistently with
        other matplotlib backends, but figure barriers between cells must
        be explicit.
        z1IPython.core.interactiveshell.InteractiveShellABC)
allow_noneN)r   r   r   __doc__r   tagrcr   r   r   r    r   Zfigure_formatr!   r   Z_print_figure_kwargs_changedr   Zclose_figuresr   r   r   r   r   r   r       sF   	
r   N)r#   Ztraitlets.config.configurabler   Z	traitletsr   r   r   r   r   r   r   r   r   r   r   r   r   <module>   s
    