Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python2.7/site-packages/future/backports/xmlrpc/ |
| [Home] [System Details] [Kill Me] |
�
,�]c@`s�dZddlmZmZmZmZddlmZmZddl m
Z
mZmZm
Z
mZddlmZddljjjZddlmZddlZddlZddlZddlZddlZddlZyddlZWnek
reZnXe d�Z!d �Z"d
e#fd��YZ$defd
��YZ%dej&e$fd��YZ'de'fd��YZ(de$fd��YZ)dej*fd��YZ+de#fd��YZ,de%fd��YZ-de'e,fd��YZ.de)e,fd��YZ/e0dkr�ddl1Z1dfd
��YZ2e'd!d"f�Zej3e4�ej3d#�d$�ej5e2�d%e
�ej6�e7d&�e7d'�yej8�Wn2e9k
r�e7d(�ej:�ej;d�nXndS()uK
Ported using Python-Future from the Python 3.3 standard library.
XML-RPC Servers.
This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.
It can also be used to handle XML-RPC requests in a CGI
environment using CGIXMLRPCRequestHandler.
The Doc* classes can be used to create XML-RPC servers that
serve pydoc-style documentation in response to HTTP
GET requests. This documentation is dynamically generated
based on the functions and methods registered with the
server.
A list of possible usage patterns follows:
1. Install functions:
server = SimpleXMLRPCServer(("localhost", 8000))
server.register_function(pow)
server.register_function(lambda x,y: x+y, 'add')
server.serve_forever()
2. Install an instance:
class MyFuncs:
def __init__(self):
# make all of the sys functions available through sys.func_name
import sys
self.sys = sys
def _listMethods(self):
# implement this method so that system.listMethods
# knows to advertise the sys methods
return list_public_methods(self) + \
['sys.' + method for method in
list_public_methods(self.sys)]
def pow(self, x, y): return pow(x, y)
def add(self, x, y) : return x + y
server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(MyFuncs())
server.serve_forever()
3. Install an instance with custom dispatch method:
class Math:
def _listMethods(self):
# this method must be present for system.listMethods
# to work
return ['add', 'pow']
def _methodHelp(self, method):
# this method must be present for system.methodHelp
# to work
if method == 'add':
return "add(2,3) => 5"
elif method == 'pow':
return "pow(x, y[, z]) => number"
else:
# By convention, return empty
# string if no help is available
return ""
def _dispatch(self, method, params):
if method == 'pow':
return pow(*params)
elif method == 'add':
return params[0] + params[1]
else:
raise ValueError('bad method')
server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(Math())
server.serve_forever()
4. Subclass SimpleXMLRPCServer:
class MathServer(SimpleXMLRPCServer):
def _dispatch(self, method, params):
try:
# We are forcing the 'export_' prefix on methods that
are
# callable through XML-RPC to prevent potential security
# problems
func = getattr(self, 'export_' + method)
except AttributeError:
raise Exception('method "%s" is not
supported' % method)
else:
return func(*params)
def export_add(self, x, y):
return x + y
server = MathServer(("localhost", 8000))
server.serve_forever()
5. CGI script:
server = CGIXMLRPCRequestHandler()
server.register_function(pow)
server.handle_request()
i(tabsolute_importtdivisiontprint_functiontunicode_literals(tinttstr(tFaulttdumpstloadstgzip_encodetgzip_decode(tBaseHTTPRequestHandlerN(tsocketservercC`sg|r|jd�}n |g}x?|D]7}|jd�rPtd|��q(t||�}q(W|S(uGresolve_dotted_attribute(a,
'b.c.d') => a.b.c.d
Resolves a dotted attribute name to an object. Raises
an AttributeError if any attribute in the chain starts with a
'_'.
If the optional allow_dotted_names argument is false, dots are not
supported and this function operates similar to getattr(obj, attr).
u.u_u(attempt to access private attribute "%s"(tsplitt
startswithtAttributeErrortgetattr(tobjtattrtallow_dotted_namestattrsti((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytresolve_dotted_attribute�s
cC`sBgt|�D]1}|jd�r
tt||��r
|^q
S(ukReturns
a list of attribute strings, found in the specified
object, which represent callable
attributesu_(tdirRtcallableR(Rtmember((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytlist_public_methods�stSimpleXMLRPCDispatchercB`s�eZdZeded�Zed�Zdd�Zd�Zd�Z ddd�Z
d�Zd�Zd �Z
d
�Zd�ZRS(
u&Mix-in class that dispatches XML-RPC requests.
This class is used to register XML-RPC method handlers
and then to dispatch them. This class doesn't need to be
instanced directly when used by SimpleXMLRPCServer but it
can be instanced when used by the MultiPathXMLRPCServer
cC`s7i|_d|_||_|p$d|_||_dS(Nuutf-8(tfuncstNonetinstancet
allow_nonetencodingtuse_builtin_types(tselfRR
R!((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt__init__�s
cC`s||_||_dS(uRegisters an instance to respond to
XML-RPC requests.
Only one instance can be installed at a time.
If the registered instance has a _dispatch method then that
method will be called with the name of the XML-RPC method and
its parameters as a tuple
e.g. instance._dispatch('add',(2,3))
If the registered instance does not have a _dispatch method
then the instance will be searched to find a matching method
and, if found, will be called. Methods beginning with an
'_'
are considered private and will not be called by
SimpleXMLRPCServer.
If a registered function matches a XML-RPC request, then it
will be called instead of the registered instance.
If the optional allow_dotted_names argument is true and the
instance does not have a _dispatch method, method names
containing dots are supported and resolved, as long as none of
the name segments start with an '_'.
*** SECURITY WARNING: ***
Enabling the allow_dotted_names options allows intruders
to access your module's global variables and may allow
intruders to execute arbitrary code on your machine. Only
use this option on a secure, closed network.
N(RR(R"RR((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytregister_instance�s! cC`s)|dkr|j}n||j|<dS(u�Registers
a function to respond to XML-RPC requests.
The optional name argument can be used to set a Unicode name
for the function.
N(Rt__name__R(R"tfunctiontname((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytregister_function�scC`s2|jji|jd6|jd6|jd6�dS(u�Registers
the XML-RPC introspection methods in the system
namespace.
see http://xmlrpc.usefulinc.com/doc/reserved.html
usystem.listMethodsusystem.methodSignatureusystem.methodHelpN(Rtupdatetsystem_listMethodstsystem_methodSignaturetsystem_methodHelp(R"((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt
register_introspection_functions�s
cC`s|jji|jd6�dS(u�Registers the XML-RPC multicall method
in the system
namespace.
see
http://www.xmlrpc.com/discuss/msgReader$1208usystem.multicallN(RR)tsystem_multicall(R"((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytregister_multicall_functions�scC`sy|t|d|j�\}}|dk r<|||�}n|j||�}|f}t|ddd|jd|j�}Wn}tk
r�}t|d|jd|j�}nMtj �\}} }
ttdd|| f�d|jd|j�}nX|j
|j�S(u�Dispatches an XML-RPC method from marshalled (XML) data.
XML-RPC methods are dispatched from the marshalled (XML) data
using the _dispatch method and the result is returned as
marshalled data. For backwards compatibility, a dispatch
function can be provided as an argument (see comment in
SimpleXMLRPCRequestHandler.do_POST) but overriding the
existing method through subclassing is the preferred means
of changing method dispatch behavior.
R!tmethodresponseiRR u%s:%sN(RR!Rt _dispatchRRR
Rtsystexc_infotencode(R"tdatatdispatch_methodtpathtparamstmethodtresponsetfaulttexc_typet exc_valuetexc_tb((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt_marshaled_dispatch�s" cC`s�t|jj��}|jdk r�t|jd�rR|t|jj��O}q�t|jd�s�|tt|j��O}q�nt|�S(uwsystem.listMethods()
=> ['add', 'subtract', 'multiple']
Returns a list of the methods supported by the
server.u_listMethodsu _dispatchN( tsetRtkeysRRthasattrt_listMethodsRtsorted(R"tmethods((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR*scC`sdS(u#system.methodSignature('add')
=> [double, int, int]
Returns a list describing the signature of the method. In the
above example, the add method takes two integers as arguments
and returns a double result.
This server does NOT support system.methodSignature.usignatures
not
supported((R"tmethod_name((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR+*scC`s�d}||jkr%|j|}ny|jdk r�t|jd�rV|jj|�St|jd�s�yt|j||j�}Wq�tk
r�q�Xq�n|dkr�dStj |�SdS(u�system.methodHelp('add')
=> "Adds two integers together"
Returns a string containing documentation for the specified
method.u_methodHelpu _dispatchuN(
RRRRBt_methodHelpRRRtpydoctgetdoc(R"RFR9((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR,7s"
c
C`s�g}x�|D]�}|d}|d}y |j|j||�g�Wq
tk
r}}|ji|jd6|jd6�q
tj�\}}} |jidd6d||fd6�q
Xq
W|S(u�system.multicall([{'methodName':
'add', 'params': [2, 2]}, ...]) => [[4], ...]
Allows the caller to package multiple XML-RPC calls into a single
request.
See http://www.xmlrpc.com/discuss/msgReader$1208
u
methodNameuparamsu faultCodeufaultStringiu%s:%s(tappendR1Rt faultCodetfaultStringR2R3(
R"t call_listtresultstcallRFR8R;R<R=R>((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR.Vs
cC`s�d}y|j|}Wnxtk
r�|jdk r�t|jd�r[|jj||�Syt|j||j�}Wq�tk
r�q�Xq�nX|dk r�||�St d|��dS(u�Dispatches
the XML-RPC method.
XML-RPC calls are forwarded to a registered function that
matches the called XML-RPC method name. If no such function
exists then the call is forwarded to the registered instance,
if available.
If the registered instance has a _dispatch method then that
method will be called with the name of the XML-RPC method and
its parameters as a tuple
e.g. instance._dispatch('add',(2,3))
If the registered instance does not have a _dispatch method
then the instance will be searched to find a matching method
and, if found, will be called.
Methods beginning with an '_' are considered private and
will
not be called.
u _dispatchumethod "%s" is not supportedN(
RRtKeyErrorRRBR1RRRt Exception(R"R9R8tfunc((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR1vs"
N(R%t
__module__t__doc__tFalseRR#R$R(R-R/R?R*R+R,R.R1(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR�s$ %
tSimpleXMLRPCRequestHandlercB`s~eZdZd
ZdZdZeZej dej
ejB�Zd�Z
d�Zd�Zd �Zd
�Zddd�ZRS(u�Simple XML-RPC request handler class.
Handles all HTTP POST requests and attempts to decode them as
XML-RPC requests.
u/u/RPC2ixi����u�
\s* ([^\s;]+) \s* #content-coding
(;\s* q \s*=\s* ([0-9\.]+))? #q
cC`s�i}|jjdd�}xl|jd�D][}|jj|�}|r+|jd�}|rjt|�nd}|||jd�<q+q+W|S(NuAccept-Encodinguu,ig�?i(theaderstgetR
t aepatterntmatchtgrouptfloat(R"trtaeteRZtv((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytaccept_encodings�scC`s!|jr|j|jkStSdS(N(t rpc_pathsR7tTrue(R"((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytis_rpc_path_valid�s cC`sl|j�s|j�dSy�d}t|jd�}g}xV|r�t||�}|jj|�}|spPn|j|�|t|d�8}q?Wdj |�}|j
|�}|dkr�dS|jj
|t|dd�|j�}Wn�tk
r�}|jd�t|jd �rx|jjrx|jd
t|��tj�} t| jdd�d�} |jd
| �n|jdd�|j�n�X|jd�|jdd�|jdk r2t|�|jkr2|j�jdd�}
|
r/y t|�}|jdd�Wq,tk
r(q,Xq/q2n|jdtt|���|j�|jj
|�dS(u�Handles the HTTP POST request.
Attempts to interpret all HTTP POST requests as XML-RPC calls,
which are forwarded to the server's _dispatch method for
handling.
Ni
iucontent-lengthi����tu _dispatchi�u_send_traceback_headeruX-exceptionuASCIIubackslashreplaceuX-tracebackuContent-lengthu0i�uContent-typeutext/xmlugzipiuContent-Encodingi(i�(!Rdt
report_404RRWtmintrfiletreadRJtlentjointdecode_request_contentRtserverR?RR7RQt
send_responseRBt_send_traceback_headertsend_headerRt tracebackt
format_excR4tend_headerstencode_thresholdRaRXR tNotImplementedErrortwfiletwrite(R"tmax_chunk_sizetsize_remainingtLt
chunk_sizetchunkR5R:R_ttracetq((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytdo_POST�sX
"
cC`s�|jjdd�j�}|dkr+|S|dkr�yt|�SWq�tk
rl|jdd|�q�tk
r�|jdd�q�Xn|jdd|�|jdd �|j�dS(
Nucontent-encodinguidentityugzipi�uencoding %r not
supportedi�uerror decoding gzip
contentuContent-lengthu0( RWRXtlowerR
RuRnt
ValueErrorRpRs(R"R5R
((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyRls
cC`s]|jd�d}|jdd�|jdtt|���|j�|jj|�dS(Ni�sNo
such pageuContent-typeu
text/plainuContent-length(RnRpRRjRsRvRw(R"R:((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyRf's
u-cC`s&|jjr"tj|||�ndS(u$Selectively log an
accepted
request.N(RmtlogRequestsRtlog_request(R"tcodetsize((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR�0s(u/u/RPC2(R%RSRTRbRttwbufsizeRctdisable_nagle_algorithmtretcompiletVERBOSEt
IGNORECASERYRaRdRRlRfR�(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyRV�s G tSimpleXMLRPCServercB`s5eZdZeZeZeeedeed�Z RS(ugSimple
XML-RPC server.
Simple XML-RPC server that allows functions and a single instance
to be installed to handle requests. The default implementation
attempts to dispatch XML-RPC calls to the functions or instance
installed in the server. Override the _dispatch method inherited
from SimpleXMLRPCDispatcher to change this behavior.
c C`s�||_tj||||�tjj||||�tdk r�ttd�r�tj|j�tj �}|tj
O}tj|j�tj|�ndS(Nu
FD_CLOEXEC(R�RR#Rt TCPServertfcntlRRBtfilenotF_GETFDt
FD_CLOEXECtF_SETFD( R"taddrtrequestHandlerR�RR
tbind_and_activateR!tflags((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR#Is
N(
R%RSRTRctallow_reuse_addressRURoRVRR#(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR�6s tMultiPathXMLRPCServercB`sJeZdZeeedeed�Zd�Zd�Z ddd�Z
RS(u\Multipath XML-RPC Server
This specialization of SimpleXMLRPCServer allows the user to create
multiple Dispatcher instances and assign them to different
HTTP request paths. This makes it possible to run two or more
'virtual XML-RPC servers' at the same port.
Make sure that the requestHandler accepts the paths in question.
c C`sGtj||||||||�i|_||_|p=d|_dS(Nuutf-8(R�R#tdispatchersRR
(R"R�R�R�RR
R�R!((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR#as
cC`s||j|<|S(N(R�(R"R7t
dispatcher((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytadd_dispatcherks
cC`s|j|S(N(R�(R"R7((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytget_dispatcheroscC`s�y
|j|j|||�}Wn`tj�d
\}}ttdd||f�d|jd|j�}|j|j�}nX|S(Niiu%s:%sR
R( R�R?R2R3RRR
RR4(R"R5R6R7R:R<R=((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR?rs
N(R%RSRTRVRcRURR#R�R�R?(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR�Ys tCGIXMLRPCRequestHandlercB`s>eZdZeded�Zd�Zd�Zdd�ZRS(u3Simple
handler for XML-RPC data passed through
CGI.cC`stj||||�dS(N(RR#(R"RR
R!((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR#�scC`sh|j|�}td�tdt|��t�tjj�tjjj|�tjjj�dS(uHandle
a single XML-RPC requestuContent-Type: text/xmluContent-Length:
%dN(R?tprintRjR2tstdouttflushtbufferRw(R"trequest_textR:((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt
handle_xmlrpc�s
cC`s�d}tj|\}}tji|d6|d6|d6}|jd�}td||f�tdtj�tdt|��t�tj j
�tj jj|�tj jj
�d S(
u�Handle a single HTTP GET request.
Default implementation indicates an error because
XML-RPC uses the POST method.
i�ucodeumessageuexplainuutf-8u
Status: %d %suContent-Type:
%suContent-Length:
%dN(
Rt responsesthttp_servertDEFAULT_ERROR_MESSAGER4R�tDEFAULT_ERROR_CONTENT_TYPERjR2R�R�R�Rw(R"R�tmessagetexplainR:((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt
handle_get�s
cC`s�|dkr4tjjdd�dkr4|j�nmyttjjdd��}Wnttfk
rrd}nX|dkr�tj j
|�}n|j|�dS(u�Handle a single XML-RPC request passed through
a CGI post method.
If no XML data is given then it is read from stdin. The resulting
XML-RPC response is printed to stdout along with the correct HTTP
headers.
uREQUEST_METHODuGETuCONTENT_LENGTHi����N(RtostenvironRXR�RR�t TypeErrorR2tstdinRiR�(R"R�tlength((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pythandle_request�s
N( R%RSRTRURR#R�R�R�(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s
t
ServerHTMLDoccB`sDeZdZdiiid�Zdiiidd�Zd�ZRS(u7Class
used to generate pydoc HTML document for a
servercC`s�|p|j}g}d}tjd�}x|j||�} | sIPn| j�\}
}|j||||
!��| j�\}}
}}}}|
r�||�jdd�}|jd||f�n�|rdt|�}|jd|||�f�n�|r7dt|�}|jd|||�f�nl|||d!d krp|j|j ||||��n3|r�|jd
|�n|j|j ||��|}q-|j|||��dj
|�S(u�Mark up some plain text, given a context of symbols to look
for.
Each context dictionary maps object names to anchor
names.iuM\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[-
]?(\d+)|(self\.)?((?:\w|\.)+))\bu"u"u<a
href="%s">%s</a>u'http://www.rfc-editor.org/rfc/rfc%d.txtu(http://www.python.org/dev/peps/pep-%04d/iu(uself.<strong>%s</strong>u(tescapeR�R�tsearchtspanRJtgroupstreplaceRtnamelinkRk(R"ttextR�RtclassesRERNtheretpatternRZtstarttendtalltschemetrfctpeptselfdotR'turl((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytmarkup�s8
" cC`s�|r|jpdd|}d} d|j|�|j|�f}
tj|�r�tj|�}tj|jd|j|j|j d|j
d|j�}n]tj|�r�tj|�}tj|j|j|j|j d|j
d|j�}nd}t
|t�r/|dp|}|dp)d}
ntj|�}
|
|| o[|jd | �}|j|
|j|||�}|o�d
|}d||fS(u;Produce HTML documentation for a function or method
object.uu-u$<a
name="%s"><strong>%s</strong></a>itannotationstformatvalueu(...)iu'<font
face="helvetica,
arial">%s</font>u<dd><tt>%s</tt></dd>u<dl><dt>%s</dt>%s</dl>
(R%R�tinspecttismethodtgetfullargspect
formatargspectargstvarargstvarkwtdefaultsR�R�t
isfunctiont
isinstancettupleRHRItgreyR�t preformat(R"tobjectR'tmodRR�REtcltanchortnotettitleR�targspect docstringtdecltdoc((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt
docroutine�s<
cC`si}x6|j�D](\}}d|||<||||<qW|j|�}d|}|j|dd�}|j||j|�} | o�d| } |d| }g}
t|j��}x3|D]+\}}|
j|j||d|��q�W||jddd d
j |
��}|S(u1Produce HTML documentation for an XML-RPC
server.u#-u)<big><big><strong>%s</strong></big></big>u#ffffffu#7799eeu<tt>%s</tt>u
<p>%s</p>
RuMethodsu#eeaa77u(
titemsR�theadingR�R�RDRJR�t
bigsectionRk(R"tserver_nametpackage_documentationREtfdicttkeytvaluetheadtresultR�tcontentstmethod_items((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt docservers"
# N(R%RSRTRR�R�R�(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s
),tXMLRPCDocGeneratorcB`s;eZdZd�Zd�Zd�Zd�Zd�ZRS(u�Generates
documentation for an XML-RPC server.
This class is designed as mix-in and should not
be constructed directly.
cC`sd|_d|_d|_dS(NuXML-RPC Server DocumentationuGThis server
exports the following methods through the XML-RPC
protocol.(R�tserver_documentationtserver_title(R"((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR#?s cC`s
||_dS(u8Set
the HTML title of the generated server
documentationN(R�(R"R�((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytset_server_titleGscC`s
||_dS(u7Set
the name of the generated HTML server
documentationN(R�(R"R�((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytset_server_nameLscC`s
||_dS(u3Set
the documentation string for the entire
server.N(R�(R"R�((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytset_server_documentationQscC`soi}x/|j�D]!}||jkr8|j|}n�|jdk rddg}t|jd�r~|jj|�|d<nt|jd�r�|jj|�|d<nt|�}|dkr�|}q*t|jd�syt|j|�}Wqt k
r|}qXq*|}nds*t
d��|||<qWt�}|j|j
|j|�}|j|j|�S( ugenerate_html_documentation()
=> html documentation for the server
Generates HTML documentation for the server using introspection for
installed functions and instances that do not implement the
_dispatch method. Alternatively, instances can choose to implement
the _get_method_argstring(method_name) method to provide the
argument string used in the documentation and the
_methodHelp(method_name) method to provide the help text used
in the
documentation.u_get_method_argstringiu_methodHelpiu _dispatchuACould not
find method in self.functions and no instance
installedN(NN(R*RRRRBt_get_method_argstringRGR�RRtAssertionErrorR�R�R�R�tpageR�(R"RERFR9tmethod_infot
documentert
documentation((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytgenerate_html_documentationVs:
(R%RSRTR#R�R�R�R�(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR�8s tDocXMLRPCRequestHandlercB`seZdZd�ZRS(u�XML-RPC
and documentation request handler class.
Handles all HTTP POST requests and attempts to decode them as
XML-RPC requests.
Handles all HTTP GET requests and interprets them as requests
for documentation.
cC`s�|j�s|j�dS|jj�jd�}|jd�|jdd�|jdtt|���|j �|j
j|�dS(u}Handles the HTTP GET request.
Interpret all HTTP GET requests as requests for server
documentation.
Nuutf-8i�uContent-typeu text/htmluContent-length(RdRfRmR�R4RnRpRRjRsRvRw(R"R:((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytdo_GET�s
(R%RSRTR�(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��stDocXMLRPCServercB`s)eZdZeeedeed�ZRS(u�XML-RPC
and HTML documentation server.
Adds the ability to serve server documentation to the capabilities
of SimpleXMLRPCServer.
c C`s3tj||||||||�tj|�dS(N(R�R#R�(R"R�R�R�RR
R�R!((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR#�s N(R%RSRTR�RcRURR#(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s tDocCGIXMLRPCRequestHandlercB`s
eZdZd�Zd�ZRS(uJHandler for XML-RPC data and documentation
requests passed through
CGIcC`sn|j�jd�}td�tdt|��t�tjj�tjjj|�tjjj�dS(u}Handles
the HTTP GET request.
Interpret all HTTP GET requests as requests for server
documentation.
uutf-8uContent-Type: text/htmluContent-Length:
%dN( R�R4R�RjR2R�R�R�Rw(R"R:((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s
cC`stj|�tj|�dS(N(R�R#R�(R"((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR#�s
(R%RSRTR�R#(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s u__main__tExampleServicecB`s$eZd�Zddd��YZRS(cC`sdS(Nu42((R"((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytgetData�stcurrentTimecB`seZed��ZRS(cC`s
tjj�S(N(tdatetimetnow(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pytgetCurrentTime�s(R%RStstaticmethodR(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s((R%RSR�R�(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyR��s u localhosti@cC`s||S(N((txty((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt<lambda>�suaddRu&Serving
XML-RPC on localhost port 8000uKIt is advisable to run this example server
within a secure, closed network.u&
Keyboard interrupt received, exiting.(<RTt
__future__RRRRtfuture.builtinsRRtfuture.backports.xmlrpc.clientRRRR R
tfuture.backports.http.serverRt backportsthttpRmR�tfuture.backportsRR2R�R�RHR�RqR�tImportErrorRRcRRR�RRVR�R�R�R�tHTMLDocR�R�R�R�R�R%RR�R(tpowR$R/R�t
serve_forevertKeyboardInterrupttserver_closetexit(((sB/usr/lib/python2.7/site-packages/future/backports/xmlrpc/server.pyt<module>is`"(
�� "(ErQ