Ñò §ÚêLc@sÐdZddkZddkZddkZddkZddklZlZlZlZdei 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 ServerHTMLDoccBsDeZdZdhhhd„Zdhhhdd„Zd„ZRS(s7Class used to generate pydoc HTML document for a servercCsÝ|p|i}g}d}tidƒ}x‹|i||ƒ} | pPn| iƒ\} } |i|||| !ƒƒ| iƒ\} } }}}}| o3|| ƒiddƒ}|id||fƒná|o1dt|ƒ}|id||| ƒfƒn©|o1dt|ƒ}|id||| ƒfƒnq|| | d!d jo#|i|i ||||ƒƒn6|o|id |ƒn|i|i ||ƒƒ| }q.|i|||ƒƒd i |ƒ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"s%ss'http://www.rfc-editor.org/rfc/rfc%d.txts(http://www.python.org/dev/peps/pep-%04d/it(sself.%st( tescapetretcompiletsearchtspantappendtgroupstreplacetinttnamelinktjoin(tselfttextRtfuncstclassestmethodstresultstheretpatterntmatchtstarttendtalltschemetrfctpeptselfdottnameturl((s'/usr/lib64/python2.6/DocXMLRPCServer.pytmarkups8!!# cCs˜|o |ipdd|}d} d|i|ƒ|i|ƒf} ti|ƒoGti|iƒ\} } } }ti| d| | |d|iƒ}nWti|ƒo@ti|ƒ\} } } }ti| | | |d|iƒ}nd}t |t ƒo&|dp|}|dpd}nt i |ƒ}| || o|i d| ƒ}|i||i|||ƒ}|od |}d ||fS( s;Produce HTML documentation for a function or method object.Rt-s$%sit formatvalues(...)is'%ss
%s
s
%s
%s
(t__name__Rtinspecttismethodt getargspectim_funct formatargspecR't isfunctiont isinstancettupletpydoctgetdoctgreyR%t preformat(RtobjectR#tmodRRRtcltanchortnotettitletargstvarargstvarkwtdefaultstargspect docstringtdecltdoc((s'/usr/lib64/python2.6/DocXMLRPCServer.pyt docroutineCs6c Csh}x6|iƒD](\}}d|||<||||%ss#ffffffs#7799ees %ss

%s

RtMethodss#eeaa77( titemsRtheadingR%R4tsortedR RCt bigsectionR1R( Rt server_nametpackage_documentationRtfdicttkeytvaluetheadtresultRBtcontentst method_items((s'/usr/lib64/python2.6/DocXMLRPCServer.pyt docserverms&   # N(R(t __module__t__doc__tNoneR%RCRR(((s'/usr/lib64/python2.6/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((s'/usr/lib64/python2.6/DocXMLRPCServer.pyt__init__s  cCs ||_dS(s8Set the HTML title of the generated server documentationN(RX(RRX((s'/usr/lib64/python2.6/DocXMLRPCServer.pytset_server_title•scCs ||_dS(s7Set the name of the generated HTML server documentationN(RI(RRI((s'/usr/lib64/python2.6/DocXMLRPCServer.pytset_server_namešscCs ||_dS(s3Set the documentation string for the entire server.N(RW(RRW((s'/usr/lib64/python2.6/DocXMLRPCServer.pytset_server_documentationŸscCskh}x+|iƒD]}||ijo|i|}ní|idj oÜddg}t|idƒo|ii|ƒ|d 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 _dispatchN(NN(tsystem_listMethodsRtinstanceRUthasattrR]R^R0RtAttributeErrorRRRRIRWtpageRX(RRt method_nametmethodt method_infot documentert documentation((s'/usr/lib64/python2.6/DocXMLRPCServer.pytgenerate_html_documentation¤s:          (R(RSRTRYRZR[R\Rj(((s'/usr/lib64/python2.6/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Ÿ|iƒp|iƒdS|iiƒ}|idƒ|iddƒ|idtt|ƒƒƒ|iƒ|i i |ƒ|i i ƒ|i i dƒdS(s}Handles the HTTP GET request. Interpret all HTTP GET requests as requests for server documentation. NiÈs Content-types text/htmlsContent-lengthi(tis_rpc_path_validt report_404tserverRjt send_responset send_headertstrtlent end_headerstwfiletwritetflusht connectiontshutdown(Rtresponse((s'/usr/lib64/python2.6/DocXMLRPCServer.pytdo_GETás     (R(RSRTRz(((s'/usr/lib64/python2.6/DocXMLRPCServer.pyRk×stDocXMLRPCServercBs&eZdZededed„ZRS(sŽXML-RPC and HTML documentation server. Adds the ability to serve server documentation to the capabilities of SimpleXMLRPCServer. icCs0ti|||||||ƒti|ƒdS(N(RRYRV(RtaddrtrequestHandlert logRequestst allow_nonetencodingtbind_and_activate((s'/usr/lib64/python2.6/DocXMLRPCServer.pyRYÿs N(R(RSRTRktFalseRUtTrueRY(((s'/usr/lib64/python2.6/DocXMLRPCServer.pyR{÷s tDocCGIXMLRPCRequestHandlercBs eZdZd„Zd„ZRS(sJHandler for XML-RPC data and documentation requests passed through CGIcCs5|iƒ}dGHdt|ƒGHHtii|ƒdS(s}Handles the HTTP GET request. Interpret all HTTP GET requests as requests for server documentation. sContent-Type: text/htmlsContent-Length: %dN(RjRrtsyststdoutRu(RRy((s'/usr/lib64/python2.6/DocXMLRPCServer.pyt handle_get s  cCsti|ƒti|ƒdS(N(RRYRV(R((s'/usr/lib64/python2.6/DocXMLRPCServer.pyRYs (R(RSRTR‡RY(((s'/usr/lib64/python2.6/DocXMLRPCServer.pyR„s ((RTR1R)R R…RRRRtHTMLDocRRVRkR{R„(((s'/usr/lib64/python2.6/DocXMLRPCServer.pyt s    "oQ