OwlCyberSecurity - MANAGER
Edit File: blocking_input.cpython-38.pyc
U ��]�+ � @ sr d Z ddlZddlmZ ddlmZ e�e�Z G dd� de �ZG dd� de�ZG dd � d e�Z G d d� de�ZdS )a� This provides several 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 `waitforbuttonpress`. `BlockingMouseInput` Creates a callable object to retrieve mouse clicks in a blocking way for interactive sessions. Used by `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 `clabel`. � N)�Integralc @ sR e Zd ZdZddd�Zdd� Zdd� Zd d � Zdd� Zddd�Z e Z ddd�ZdS )� BlockingInputz1Callable for retrieving events in a blocking way.� c C s || _ || _d S �N��fig� eventslist)�selfr r r r �;/usr/lib/python3/dist-packages/matplotlib/blocking_input.py�__init__! s zBlockingInput.__init__c C sT | � |� t�dt| j�� | �� t| j�| j kr@dkrPn n| jj� � dS )zY Event handler; will be passed to the current figure to retrieve events. zEvent %ir N) � add_event�_log�info�len�events� post_event�nr �canvas�stop_event_loop�r �eventr r r �on_event% s zBlockingInput.on_eventc C s dS )z-For baseclass, do nothing but collect events.Nr �r r r r r 5 s zBlockingInput.post_eventc C s$ | j D ]}| jj�|� qg | _ dS )zDisconnect all callbacks.N)� callbacksr r Zmpl_disconnect)r �cbr r r �cleanup8 s zBlockingInput.cleanupc C s | j �|� dS )z5For base class, this just appends an event to events.N)r �appendr r r r r >