|
Server : Apache System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64 User : equistyl ( 1341) PHP Version : 8.1.30 Disable Function : NONE Directory : /lib64/python2.7/site-packages/matplotlib/ |
Upload File : |
�
r`]c @ s� d Z d d l m Z d d l m Z d d l m Z d d l j Z d e
f d � � YZ d e f d � � YZ d
e f d � � YZ
d e f d
� � YZ d S( s0
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����( t print_function( t verbose( t is_sequence_of_stringsNt
BlockingInputc B sq e Z d Z d d � Z d � Z d � Z d � Z d � Z d d � Z d d � Z e j e _ d d
d � Z
RS(
sX
Class that creates a callable object to retrieve events in a
blocking way.
c C s | | _ | | _ d S( N( t figt
eventslist( t selfR R ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt __init__$ s c C so | j | � t j d t | j � � | j � t | j � | j k rk | j d k rk | j j j � n d S( se
Event handler that will be passed to the current figure to
retrieve events.
s Event %ii N(
t add_eventR t reportt lent eventst
post_eventt nR t canvast stop_event_loop( R t event( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt on_event* s
'c C s d S( s, For baseclass, do nothing but collect eventsN( ( R ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR = s c C s4 x$ | j D] } | j j j | � q
Wg | _ d S( s Disconnect all callbacksN( t callbacksR R t mpl_disconnect( R t cb( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt cleanupA s c C s | j j | � d S( s5 For base class, this just appends an event to events.N( R t append( R R ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR H s i����c C s | j j | � d S( 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( R t pop( R t index( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt pop_eventL s c C s | j | � d S( N( R ( R R ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR V s i i c C s� | | _ g | _ g | _ | j j � x6 | j D]+ } | j j | j j j | | j � � q2 Wz | j j j
d | � Wd | j � X| j S( s4
Blocking call to retrieve n events
t timeoutN( R
R R R t showR R R t mpl_connectR t start_event_loopR ( R R
R ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyt __call__Z s
( ( t __name__t
__module__t __doc__R R R R R R R R ( ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR s
t BlockingMouseInputc B s� e Z d Z d Z d Z d Z d d d d � Z d � Z d � Z d � Z d � Z
d � Z d
� Z d � Z
d d
� Z d d � Z d d � Z d d e d � Z RS( 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).
i i i c C s8 t j | d | d d �| | _ | | _ | | _ d S( NR R t button_press_eventt key_press_event( R# R$ ( R R t
button_addt
button_popt button_stop( R R t mouse_addt mouse_popt
mouse_stop( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR � s c C s1 | j d j d k r# | j � n
| j � d S( s7
This will be called to process events
i����R$ N( R t namet key_eventt mouse_event( R ( ( s? /usr/lib64/python2.7/site-packages/matplotlib/blocking_input.pyR � s
c C se | j d } | j } | | j k r5 | j | � n, | | j k rT | j | � n
| j | � d S( s Process a mouse click eventi����N( R t buttonR&