/usr/lib/python3/dist-packages/twisted/web/__pycache__
Edit: /usr/lib/python3/dist-packages/twisted/web/__pycache__/xmlrpc.cpython-310.pyc (20015B)
o
bR @ s& d Z ddlZddlmZ ddlmZ ddlmZmZm Z m
Z
ddlmZm
Z
mZ ddlmZ ddlmZmZ ddlmZ dd lmZmZmZ d
ZdZdd
ZG dd de
ZG dd dZG dd dejZ G dd de Z!dd Z"G dd dej#Z$dZ%G dd dej&Z'G dd dZ(g dZ)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}
N)urlparse)BinaryBooleanDateTimeFault)defererrorprotocol)Logger)failurereflect)nativeString)httpresourceserverA 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 5 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 Deferredresultrun)selfr argsr r r __init__L s
zHandler.__init__c G s | j td d S )NzImplement run() in subclasses)r errbackNotImplementedError)r! r" r r r r Q s zHandler.runN)r r r r r# r r r r r r ; s r c @ s~ e Zd ZdZdZdZdZdZdZe Z
ddd Zd
d Zdd
Z
dd Zdd Zdd ZdddZdd Zdd Zdd ZdS )XMLRPCa
A resource that implements XML-RPC.
You probably want to connect this to '/RPC2'.
Methods published can return XML-RPC serializable results, Faults,
Binary, Boolean, DateTime, Deferreds, or Handler instances.
By default methods beginning with 'xmlrpc_' are published.
Sub-handlers for prefixed methods (e.g., system.listMethods)
can be added with putSubHandler. By default, prefixes are
separated with a '.'. Override self.separator to change this.
@ivar allowNone: Permit XML translating of Python constant None.
@type allowNone: C{bool}
@ivar useDateTime: Present C{datetime} values as C{datetime.datetime}
objects?
@type useDateTime: C{bool}
r r .) POSTFc C s" t j| i | _|| _|| _d S r )r Resourcer# subHandlers allowNoneuseDateTime)r! r, r- r r r r# w s
zXMLRPC.__init__c C || j |<