0x1949 Team - FAZEMRX - MANAGER
Edit File: base.cpython-310.pyc
o RѰU�? � @ s� d Z ddlmZ ddlmZ ddlmZmZmZm Z m Z mZmZ ed�Z de _ dZG dd� de�Zed �ZG d d� de�ZG dd � d e�ZG dd� de�Ze� jZdS )a+ Signals and events. A small implementation of signals, inspired by a snippet of Django signal API client code seen in a blog post. Signals are first-class objects and each manages its own receivers and message emission. The :func:`signal` function provides singleton behavior for named signals. � )�warn)�WeakValueDictionary)� WeakTypes�contextmanager�defaultdict�hashable_identity� lazy_property� reference�symbol�ANYzToken for "any sender".c @ s� e Zd ZdZeZedd� �Zedd� �Zd%dd�Zed fd d�Z d&d d�Z eefdd��Zefdd�Z dd� Zdd� Zdd� Zefdd�Zdd� Zdd� Zdd � Zd!d"� Zd#d$� ZdS )'�SignalzA notification emitter.c C � t dd�S )z�Emitted after each :meth:`connect`. The signal sender is the signal instance, and the :meth:`connect` arguments are passed through: *receiver*, *sender*, and *weak*. .. versionadded:: 1.2 z"Emitted after a receiver connects.��doc�r ��self� r �./usr/lib/python3/dist-packages/blinker/base.py�receiver_connected% s zSignal.receiver_connectedc C r )a Emitted after :meth:`disconnect`. The sender is the signal instance, and the :meth:`disconnect` arguments are passed through: *receiver* and *sender*. Note, this signal is emitted **only** when :meth:`disconnect` is called explicitly. The disconnect signal can not be emitted by an automatic disconnect (due to a weakly referenced receiver or sender going out of scope), as the receiver and/or sender instances are no longer available for use at the time this signal would be emitted. An alternative approach is available by subscribing to :attr:`receiver_connected` and setting up a custom weakref cleanup callback on weak receivers and senders. .. versionadded:: 1.2 z%Emitted after a receiver disconnects.r r r r r r �receiver_disconnected1 s zSignal.receiver_disconnectedNc C s. |r|| _ i | _tt�| _tt�| _i | _dS )zt :param doc: optional. If provided, will be assigned to the signal's __doc__ attribute. N)�__doc__� receiversr �set�_by_receiver� _by_sender� _weak_senders)r r r r r �__init__I s zSignal.__init__Tc C s6 t |�}|rt|| j�}||_n|}|tu rt}nt |�}| j�||� | j| � |� | j | � |� ~|tur[|| jvr[zt|| j�}||_ W n tyR Y n w | j�||� ~d| jv r{| jjr{z| jj| |||d� W n | �||� � tjr�| tur�ztj| |||d� W |S | �||� � |S )aa Connect *receiver* to signal events sent by *sender*. :param receiver: A callable. Will be invoked by :meth:`send` with `sender=` as a single positional argument and any \*\*kwargs that were provided to a call to :meth:`send`. :param sender: Any object or :obj:`ANY`, defaults to ``ANY``. Restricts notifications delivered to *receiver* to only those :meth:`send` emissions sent by *sender*. If ``ANY``, the receiver will always be notified. A *receiver* may be connected to multiple *sender* values on the same Signal through multiple calls to :meth:`connect`. :param weak: If true, the Signal will hold a weakref to *receiver* and automatically disconnect when *receiver* goes out of scope or is garbage collected. Defaults to True. r )�receiver�sender�weak)�receiver_arg� sender_arg�weak_arg)r r �_cleanup_receiver�receiver_idr �ANY_IDr � setdefaultr �addr r �_cleanup_sender� sender_id� TypeError�__dict__r �send� disconnect)r r r r r% �receiver_refr* � sender_refr r r �connect\ sZ � � ���zSignal.connectFc s � ��fdd�}|S )aK Connect the decorated function as a receiver for *sender*. :param sender: Any object or :obj:`ANY`. The decorated function will only receive :meth:`send` emissions sent by *sender*. If ``ANY``, the receiver will always be notified. A function may be decorated multiple times with differing *sender* values. :param weak: If true, the Signal will hold a weakref to the decorated function and automatically disconnect when *receiver* goes out of scope or is garbage collected. Unlike :meth:`connect`, this defaults to False. The decorated function will be invoked by :meth:`send` with `sender=` as a single positional argument and any \*\*kwargs that were provided to the call to :meth:`send`. .. versionadded:: 1.1 c s � � | ��� | S �N)r1 )�fn�r r r r r � decorator� s z%Signal.connect_via.<locals>.decoratorr )r r r r5 r r4 r �connect_via� s zSignal.connect_viac c s>