0x1949 Team - FAZEMRX - MANAGER
Edit File: util.cpython-310.pyc
o �b� � @ s� d Z ddlmZ ddlmZmZ ddlmZ ddlm Z ddl mZ G dd� d�ZG d d � d �Z G dd� d�ZG d d� d�ZG dd� de�Zeej�G dd� de��ZG dd� dej�Zdd� ZdS )z Utility classes for spread. � )�implementer)�defer� interfaces)�basic)�Failure)�pbc @ s e Zd Zdd� Zdd� ZdS )�LocalMethodc C s || _ || _d S �N)�local�name)�selfr r � r �5/usr/lib/python3/dist-packages/twisted/spread/util.py�__init__ � zLocalMethod.__init__c O s | j j| jg|�R i |��S r )r � callRemoter )r �args�kwr r r �__call__ s zLocalMethod.__call__N)�__name__� __module__�__qualname__r r r r r r r s r c @ s$ e Zd ZdZdZdd� Zdd� ZdS )� LocalAsRemotezN A class useful for emulating the effects of remote behavior locally. � c O s| t | d| �rt| d| �|i |��S zt| d| �}t�||i |���W S ty= t� }| jr6|�� t�|� Y S w )ax Call a specially-designated local method. self.callRemote('x') will first try to invoke a method named sync_x and return its result (which should probably be a Deferred). Second, it will look for a method called async_x, which will be called and then have its result (or Failure) automatically wrapped in a Deferred. �sync_�async_) �hasattr�getattrr �succeed� BaseExceptionr �reportAllTracebacks�printTraceback�fail)r r r r �method�fr r r r # s �zLocalAsRemote.callRemotec C s t | |�S r )r )r r r r r �remoteMethod8 � zLocalAsRemote.remoteMethodN)r r r �__doc__r r r% r r r r r s r c @ s* e Zd ZdZd dd�Zdd� Zdd� Zd S )�LocalAsyncForwarderzD A class useful for forwarding a locally-defined interface. r c C s$ |� |�sJ �|| _|| _|| _d S r )� providedBy� forwarded�interfaceClass�failWhenNotImplemented)r r* r+ r, r r r r A s zLocalAsyncForwarder.__init__c O s t | j|�|i |��S r )r r* )r r# r r r r r �_callMethodG s zLocalAsyncForwarder._callMethodc O sP | j �|�rtj| j|g|�R i |��}|S | jr#t�ttd| ��S t� d �S )NzNo Such Method in Interface: %s) r+ �queryDescriptionForr � maybeDeferredr- r, r"