tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
K\¬Qc@sÐdZddlZddlZddlZddlZddlmZmZmZmZdej    fd„ƒYZ
ddd„ƒYZ defd    „ƒYZ d
ee fd „ƒYZ d ee fd „ƒYZdS(sKSelf documenting XML-RPC Server.
 
This module 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.
 
This module is built upon the pydoc and SimpleXMLRPCServer
modules.
iÿÿÿÿN(tSimpleXMLRPCServertSimpleXMLRPCRequestHandlertCGIXMLRPCRequestHandlertresolve_dotted_attributet ServerHTMLDoccBsDeZdZdiiid„Zdiiidd„Zd„ZRS(s7Class used to generate pydoc HTML document for a servercCsÐ|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|||ƒƒd j
|ƒS( sƒMark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.isM\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?((?:\w|\.)+))\bt"s&quot;s<a href="%s">%s</a>s'http://www.rfc-editor.org/rfc/rfc%d.txts(http://www.python.org/dev/peps/pep-%04d/it(sself.<strong>%s</strong>t( tescapetretcompiletsearchtspantappendtgroupstreplacetinttnamelinktjoin(tselfttextRtfuncstclassestmethodstresultstheretpatterntmatchtstarttendtalltschemetrfctpeptselfdottnameturl((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pytmarkups8  "    c CsŒ|r|jpdd|}d}    d|j|ƒ|j|ƒf}
tj|ƒrštj|jƒ\} } } }tj| d| | |d|jƒ}nTtj|ƒrètj|ƒ\} } } }tj| | | |d|jƒ}nd}t    |t
ƒr |dp
|}|dpd}nt j |ƒ}|
||    oL|j d|    ƒ}|j||j|||ƒ}|o{d    |}d
||fS( s;Produce HTML documentation for a function or method object.Rt-s$<a name="%s"><strong>%s</strong></a>it formatvalues(...)is'<font face="helvetica, arial">%s</font>s<dd><tt>%s</tt></dd>s<dl><dt>%s</dt>%s</dl>
(t__name__Rtinspecttismethodt
getargspectim_funct formatargspecR't
isfunctiont
isinstancettupletpydoctgetdoctgreyR%t    preformat(RtobjectR#tmodRRRtcltanchortnotettitletargstvarargstvarkwtdefaultstargspect    docstringtdecltdoc((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyt
docroutineCs6c Csi}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    t    j
|
ƒƒ}|S(
s1Produce HTML documentation for an XML-RPC server.s#-s)<big><big><strong>%s</strong></big></big>s#ffffffs#7799ees <tt>%s</tt>s
<p>%s</p>
RtMethodss#eeaa77( titemsRtheadingR%R4tsortedR RCt
bigsectionR1R( Rt server_nametpackage_documentationRtfdicttkeytvaluetheadtresultRBtcontentst method_items((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyt    docserverms"
#    N(R(t
__module__t__doc__tNoneR%RCRR(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyRs
))tXMLRPCDocGeneratorcBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s…Generates documentation for an XML-RPC server.
 
    This class is designed as mix-in and should not
    be constructed directly.
    cCsd|_d|_d|_dS(NsXML-RPC Server DocumentationsGThis server exports the following methods through the XML-RPC protocol.(RItserver_documentationt server_title(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyt__init__s        cCs ||_dS(s8Set the HTML title of the generated server documentationN(RX(RRX((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pytset_server_title•scCs ||_dS(s7Set the name of the generated HTML server documentationN(RI(RRI((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pytset_server_namešscCs ||_dS(s3Set the documentation string for the entire server.N(RW(RRW((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pytset_server_documentationŸscCsoi}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(    sgenerate_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.t_get_method_argstringit _methodHelpit    _dispatchsACould not find method in self.functions and no instance installedN(NN(tsystem_listMethodsRtinstanceRUthasattrR]R^R0RtAttributeErrortAssertionErrorRRRRIRWtpageRX(RRt method_nametmethodt method_infot
documentert documentation((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pytgenerate_html_documentation¤s:                       (R(RSRTRYRZR[R\Rk(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyRV†s                 tDocXMLRPCRequestHandlercBseZdZd„ZRS(sè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.
    cCs€|jƒs|jƒdS|jjƒ}|jdƒ|jddƒ|jdtt|ƒƒƒ|jƒ|j    j
|ƒdS(s}Handles the HTTP GET request.
 
        Interpret all HTTP GET requests as requests for server
        documentation.
        NiÈs Content-types    text/htmlsContent-length( tis_rpc_path_validt
report_404tserverRkt send_responset send_headertstrtlent end_headerstwfiletwrite(Rtresponse((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pytdo_GETás 
 
(R(RSRTRx(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyRl×stDocXMLRPCServercBs&eZdZededed„ZRS(sŽXML-RPC and HTML documentation server.
 
    Adds the ability to serve server documentation to the capabilities
    of SimpleXMLRPCServer.
    icCs0tj|||||||ƒtj|ƒdS(N(RRYRV(RtaddrtrequestHandlert logRequestst
allow_nonetencodingtbind_and_activate((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyRYûs N(R(RSRTRltFalseRUtTrueRY(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyRyós    tDocCGIXMLRPCRequestHandlercBs eZdZd„Zd„ZRS(sJHandler for XML-RPC data and documentation requests passed through
    CGIcCs5|jƒ}dGHdt|ƒGHHtjj|ƒdS(s}Handles the HTTP GET request.
 
        Interpret all HTTP GET requests as requests for server
        documentation.
        sContent-Type: text/htmlsContent-Length: %dN(RkRstsyststdoutRv(RRw((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyt
handle_gets
 cCstj|ƒtj|ƒdS(N(RRYRV(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyRYs (R(RSRTR…RY(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyR‚s    ((RTR1R)R    RƒRRRRtHTMLDocRRVRlRyR‚(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/DocXMLRPCServer.pyt<module> s    "oQ