← Back
Editing: xmlrpc.cpython-38.pyc
U ��W[�N � @ s\ d Z ddlmZmZ ddlmZmZmZmZ ddlm Z ddl Z erRddlmZ nddl Z ddlmZmZmZ ddlmZmZmZ ddlmZmZ dd lmZ d ZdZe jZe jZe jZe j Z dd � Z!G dd� de�Z"G dd� d�Z#G dd� dej$�Z%G dd� de%�Z&dd� Z'G dd� dej(�Z)dZ*G dd� dej+�Z,G dd� d�Z-dddddd d!d"gZ.dS )#z� A generic resource for publishing objects via XML-RPC. Maintainer: Itamar Shtull-Trauring @var Fault: See L{xmlrpclib.Fault} @type Fault: L{xmlrpclib.Fault} � )�division�absolute_import)�_PY3� intToBytes�nativeString�urllib_parse)�unicodeN)�resource�server�http)�defer�protocol�reactor)�reflect�failure)�Logger�A �B c C s d| _ | S )a\ Decorator to cause the request to be passed as the first argument to the method. If an I{xmlrpc_} method is wrapped with C{withRequest}, the request object is passed as the first argument to that method. For example:: @withRequest def xmlrpc_echo(self, request, s): return s @since: 10.2 T)�withRequest)�f� r �4/usr/lib/python3/dist-packages/twisted/web/xmlrpc.pyr , s r c @ s e Zd ZdZdS )�NoSuchFunctionz1 There is no function by the given name. N)�__name__� __module__�__qualname__�__doc__r r r r r @ s r c @ s e Zd ZdZdd� Zdd� ZdS )�HandleraP Handle a XML-RPC request and store the state for a request in progress. Override the run() method and return result using self.result, a Deferred. We require this class since we're not using threads, so we can't encapsulate state in a running function if we're going to have to wait for results. For example, lets say we want to authenticate against twisted.cred, run a LDAP query and then pass its result to a database query, all as a result of a single XML-RPC command. We'd use a Handler instance to store the state of the running command. c G s || _ t�� | _| j|� d S �N)r r �Deferred�result�run)�selfr �argsr r r �__init__W s zHandler.__init__c G s | j �td�� d S )NzImplement run() in subclasses)r �errback�NotImplementedError)r"