ó ô^‚Rc @ sÐ d Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z m Z d e j f d „ ƒ YZ d d d „ ƒ YZ d e f d „ ƒ YZ d e e f d „ ƒ YZ d e e f d „ ƒ YZ d S( sK Self 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( t SimpleXMLRPCServert SimpleXMLRPCRequestHandlert CGIXMLRPCRequestHandlert resolve_dotted_attributet ServerHTMLDocc B sD e Z d Z d i i i d „ Z d i i i d d „ Z d „ Z RS( s7 Class used to generate pydoc HTML document for a serverc C sÐ | p | j } g } d } t j d ƒ } x| j | | ƒ } | sI Pn | j ƒ \ } } | j | | | | !ƒ ƒ | j ƒ \ } } } } } } | rË | | ƒ j d d ƒ } | j d | | f ƒ nØ | rd t | ƒ } | j d | | | ƒ f ƒ n¢ | r7d t | ƒ } | j d | | | ƒ f ƒ nl | | | d !d k rp| j | j | | | | ƒ ƒ n3 | rŠ| j d | ƒ 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.i sM \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/i t (s self.%st ( t escapet ret compilet searcht spant appendt groupst replacet intt namelinkt join( t selft textR t funcst classest methodst resultst heret patternt matcht startt endt allt schemet rfct pept selfdott namet url( ( s% /usr/lib/python2.7/DocXMLRPCServer.pyt markup s8 " c C sŒ | r | j p d d | } d } d | j | ƒ | j | ƒ f } t j | ƒ rš t j | j ƒ \ } } } } t j | d | | | d | j ƒ} nT t j | ƒ rè t j | ƒ \ } } } } t j | | | | d | j ƒ} n d } t | t ƒ r | d p | } | d pd } n t j | ƒ } | | | oL| j d | ƒ } | j | | j | | | ƒ } | o{d | } d | | f S( s; Produce HTML documentation for a function or method object.R t -s$ %si t formatvalues (...)i s' %ss