HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyo
�
�)�Uc@s�dZddlmZmZddlmZddljZde	fd��YZ
de
fd��YZd	efd
��YZde
fd��YZ
dS(
s 
This provides several classes used for blocking interaction with figure windows:

:class:`BlockingInput`
    creates a callable object to retrieve events in a blocking way for interactive sessions

:class:`BlockingKeyMouseInput`
    creates a callable object to retrieve key or mouse clicks in a blocking way for interactive sessions.
    Note: Subclass of BlockingInput. Used by waitforbuttonpress

:class:`BlockingMouseInput`
    creates a callable object to retrieve mouse clicks in a blocking way for interactive sessions.
    Note: Subclass of BlockingInput.  Used by ginput

:class:`BlockingContourLabeler`
    creates a callable object to retrieve mouse clicks in a blocking way that will then be used to place labels on a ContourSet
    Note: Subclass of BlockingMouseInput.  Used by clabel
i����(tpathtverbose(tis_sequence_of_stringsNt
BlockingInputcBsqeZdZdd�Zd�Zd�Zd�Zd�Zdd�Zdd�Z	eje	_d	d
d�Z
RS(
sX
    Class that creates a callable object to retrieve events in a
    blocking way.
    cCs||_||_dS(N(tfigt
eventslist(tselfRR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt__init__s	cCso|j|�tjdt|j��|j�t|j�|jkrk|jdkrk|jjj	�ndS(se
        Event handler that will be passed to the current figure to
        retrieve events.
        sEvent %iiN(
t	add_eventRtreporttlenteventst
post_eventtnRtcanvaststop_event_loop(Rtevent((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyton_event"s


'cCsdS(s,For baseclass, do nothing but collect eventsN((R((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR5scCs4x$|jD]}|jjj|�q
Wg|_dS(sDisconnect all callbacksN(t	callbacksRRtmpl_disconnect(Rtcb((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pytcleanup9scCs|jj|�dS(s5For base class, this just appends an event to events.N(Rtappend(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR@si����cCs|jj|�dS(s'
        This removes an event from the event list.  Defaults to
        removing last event, but an index can be supplied.  Note that
        this does not check that there are events, much like the
        normal pop method.  If not events exist, this will throw an
        exception.
        N(Rtpop(Rtindex((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt	pop_eventDscCs|j|�dS(N(R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRNsiicCs�||_g|_g|_|jj�x6|jD]+}|jj|jjj||j	��q2Wz|jjj
d|�Wd|j�X|jS(s4
        Blocking call to retrieve n events
        ttimeoutN(R
RRRtshowRRRtmpl_connectRtstart_event_loopR(RR
R((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt__call__Rs			
)((t__name__t
__module__t__doc__RRRRRRRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRs				
tBlockingMouseInputcBs�eZdZdZdZdZdddd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dd
�Zdd�Zdd�Zdded�ZRS(s;
    Class that creates a callable object to retrieve mouse clicks in a
    blocking way.

    This class will also retrieve keyboard clicks and treat them like
    appropriate mouse clicks (delete and backspace are like mouse button 3,
    enter is like mouse button 2 and all others are like mouse button 1).
    iiicCs8tj|d|dd�||_||_||_dS(NRRtbutton_press_eventtkey_press_event(R#R$(RRt
button_addt
button_poptbutton_stop(RRt	mouse_addt	mouse_popt
mouse_stop((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR|s		cCs1|jdjdkr#|j�n
|j�dS(s7
        This will be called to process events
        i����R$N(Rtnamet	key_eventtmouse_event(R((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR�s
cCse|jd}|j}||jkr5|j|�n,||jkrT|j|�n
|j|�dS(sProcess a mouse click eventi����N(RtbuttonR&tmouse_event_popR'tmouse_event_stoptmouse_event_add(RRR.((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR-�s
	cCsx|jd}|jdkr dS|jj�}|dkrK|j|�n)|dkrg|j|�n
|j|�dS(	so
        Process a key click event.  This maps certain keys to appropriate
        mouse click events.
        i����Nt	backspacetdeletetescapetenter(R2R3(sescapeR5(RtkeytNonetlowerR/R0R1(RRR6((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR,�s
cCs-|jr|j|�ntj|d�dS(s�
        Will be called for any event involving a button other than
        button 2 or 3.  This will add a click if it is inside axes.
        i����N(tinaxest	add_clickRR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR1�s	cCs$tj|d�|jjj�dS(sh
        Will be called for any event involving button 2.
        Button 2 ends blocking input.
        i����N(RRRRR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR0�scCs<tj|d�t|j�dkr8|j|d�ndS(sk
        Will be called for any event involving button 3.
        Button 3 removes the last click.
        i����iN(RRR
R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR/�scCs�|jj|j|jf�tjdt|j�|j|jf�|jr�tj	|jg|jgdddd�}|j
j|�|jj|�|j
jj�ndS(sL
        This add the coordinates of an event to the list of clicks
        sinput %i: %f,%ftmarkert+tcolortrN(tclicksRtxdatatydataRR	R
tshow_clickstmlinestLine2DR9tadd_linetmarksRRtdraw(RRtline((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR:�s	 	i����cCsL|jj|�|jrH|jj|�}|j�|jjj�ndS(sm
        This removes a click from the list of clicks.  Defaults to
        removing the last click.
        N(R?RRBRFtremoveRRRG(RRRtmark((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt	pop_click�s
	
cCs$|j||�tj||�dS(s�
        This removes a click and the associated event from the object.
        Defaults to removing the last click, but any index can be
        supplied.
        N(RKRR(RRR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR�scCsT|jrCx|jD]}|j�qWg|_|jjj�ntj|�dS(N(RBRFRIRRRGRR(RRRJ((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRs		icCs;||_g|_g|_tj|d|d|�|jS(s\
        Blocking call to retrieve n coordinate pairs through mouse
        clicks.
        R
R(RBR?RFRR(RR
RRB((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRs
			N(RR R!R%R&R'RRR-R,R1R0R/R:RKRR7RtTrueR(((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR"ns 
		
		
				
tBlockingContourLabelercBsPeZdZd�Zd�Zdd�Zd�Zd�Zdddd�ZRS(	s�
    Class that creates a callable object that uses mouse clicks or key
    clicks on a figure window to place contour labels.
    cCs&||_tj|d|jj�dS(NR(tcsR"Rtaxtfigure(RRN((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR#s	cCs|j|�dS(N(tbutton1(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR:'si����cCs|j|�dS(N(tbutton3(RRR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRK*scCs�|j}|j|jkr�|j|j|j|j�d \}}}}}|jj|�}|j|j	�}	|	|j
}
|jjj|
�}|j
|j||j|j|�}|jr�|
}
nd}
|j||||
|j�\}}|j||||j||j|�|jrq|	j|�x<|D]1}t|�dkr9|	jtj|��q9q9Wn|jjj�n
tj|�dS(s�
        This will be called if an event involving a button other than
        2 or 3 occcurs.  This will add a label to a contour.
        iiN( RNR9ROtfind_nearest_contourtxtytlabelIndiceListRtcollectionst	get_pathstverticest	transDatat	transformtget_label_widthtlabelLevelListtlabelFmttlabelFontSizeListtinlineR7tcalc_label_rot_and_inlinetinline_spacingt	add_labeltlabelCValueListRR
RRtPathRRRGR(RRRNtconmintsegmintimintxmintymintlmintpathstlctslctlwtlcargtrotationtnlcR
((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRQ-s2	+

			

 cCs3|jrn#|jj�|jjjjj�dS(sY
        This will be called if button 3 is clicked.  This will 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.
        N(R`RNt	pop_labelRORPRRG(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRRfs		
icCs5||_||_tj|d|d|dt�dS(NR
RRB(R`RbR"RtFalse(RR`RbR
R((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRus		(	RR R!RR:RKRQRRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRMs			9	tBlockingKeyMouseInputcBs,eZdZd�Zd�Zdd�ZRS(s_
    Class that creates a callable object to retrieve a single mouse or
    keyboard click
    cCstj|d|dd�dS(NRRR#R$(sbutton_press_eventskey_press_event(RR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR�scCs|jdjdk|_dS(s1
        Determines if it is a key event
        i����R$N(RR+t
keyormouse(R((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR�sicCs)d|_tj|ddd|�|jS(s�
        Blocking call to retrieve a single mouse or key click
        Returns True if key click, False if mouse, or None if timeout
        R
iRN(R7RvRR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR�s	(RR R!RRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyRu|s		(R!t
matplotlibRRtmatplotlib.cbookRtmatplotlib.linestlinesRCtobjectRR"RMRu(((sL/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt<module>sV�^