;ò
Zø/@c           @   sN   d  Z  d k Z d k Z d k l Z d „  Z d f  d „  ƒ  YZ d „  Z d S(   s   
XMLRPC services dispatcher.
N(   s   plugin_utilsc         C   s$   t  d d ƒ i d t |  ƒ ƒ d S(   sG   
    Just a simple Debugger to see what happens when I screwed up.
    s   xmlrpc.debugs   as
   DEBUG: %s
N(   s   opens   writes   strs   dbg(   s   dbg(    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys   debug   s     s   xmlrpcHandlerc           B   s)   t  Z d  Z d „  Z d „  Z d „  Z RS(   s·   
    XMLRPC services dispatcher and handler.

    Responsible for handling XMLRPC services request. XMLRPC methods and
    services are available from C{Pyblosxom.xmlrpcplugins}.
    c         C   sE   | |  _ | |  _ t i | i ƒ  ƒ |  i i h  d t i	 <ƒ d  S(   Ns   xmlrpc_methods(
   s   requests   selfs   _requests   datas   _datas   plugin_utilss   initialize_xmlrpc_pluginss   getConfigurations   addDatas   methods(   s   selfs   requests   data(    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys   __init__   s    		c         C   sJ  yó t  i |  i ƒ \ } } t | ƒ } | i d |  i ƒ t	 | ƒ } y< |  i
 | | ƒ } t | ƒ t f  ƒ j o | f } n WnX t  i j
 o } t  i | ƒ } nH t  i t  i d d t i t i f ƒ ƒ } n Xt  i | d d ƒ} Wn d t i t i f } n Xd t | ƒ | f } t i i | ƒ t i i ƒ  d  S(   Ni    i   s   %s:%ss   methodresponses<   Content-type: text/plain

XML-RPC call expected
Debug: %s:%ss-   Content-type: text/xml
Content-length: %d

%s(   s	   xmlrpclibs   loadss   selfs   _datas   paramss   methods   lists   inserts   _requests   tuples
   xmlrpcCalls   responses   types   Faults   faultobjs   dumpss   syss   exc_types	   exc_values   resp_strs   lens   stdouts   writes   flush(   s   selfs   resp_strs   faultobjs   responses   paramss   method(    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys   process   s&    /c         C   sY   |  i i ƒ  d } | i | t ƒ } t | ƒ o t	 | | ƒ Sn t i d d ƒ ‚ d S(   s   XML-RPC dispatchers   xmlrpc_methodss   Method Errors   Method Does not ExistN(   s   selfs   _requests   getDatas   methodss   gets	   meth_names   Nones   func_objs   callables   applys   argss	   xmlrpclibs   Fault(   s   selfs	   meth_names   argss   methodss   func_obj(    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys
   xmlrpcCall@   s     (   s   __name__s
   __module__s   __doc__s   __init__s   processs
   xmlrpcCall(    (    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys   xmlrpcHandler   s    		"c         C   sP   |  i ƒ  d d } | i | ƒ p | | | j o t i d d ƒ ‚ n d S(   s
  
    A convenient authentication for plugins to use

    @param request: Request object for the current request
    @type request: L{Pyblosxom.Request.Request} object
    @param username: Username for authentication
    @type username: string
    @param password: Password for authentication
    @type password: string
    @raises xmlrpclib.Fault: This happens when the username password combo is
        wrong
    @warning: The L{Pyblosxom.Request.Request} must contain a configuration dict
        with C{['xmlrpc']['usernames']} in it. The username is derived from the
        key value pair dict there:

        >>> req = Pyblosxom.Request.Request()
        >>> req.addConfiguration({'xmlrpc': {'usernames': {'foo': 'bar'}}})
        >>> authenticate(req, 'foo', 'bar')
    s   xmlrpcs	   usernamess   PasswordErrors   Error in username or passwordN(   s   requests   getConfigurations   auths   has_keys   usernames   passwords	   xmlrpclibs   Fault(   s   requests   usernames   passwords   auth(    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys   authenticateJ   s     "(   s   __doc__s	   xmlrpclibs   syss	   Pyblosxoms   plugin_utilss   debugs   xmlrpcHandlers   authenticate(   s   authenticates   plugin_utilss	   xmlrpclibs   syss   debugs   xmlrpcHandler(    (    s;   /mit/python/lib/python2.3/site-packages/Pyblosxom/xmlrpc.pys   ?   s
   	<