Commits

Olemis Lang committed b9b7de2

TracRpc: Authenticated XML-RPC call in docs (Python). Testing G-expansion.

Comments (0)

Files changed (1)

t5437/t5437-protocol_api-r7194.diff

 +            self.log.exception("Syntax error rendering protocol documentation")
 +            return "'''Syntax error:''' [[BR]] %s" % (str(exc),)
 +        except Exception:
-+            self.log.exception("Syntax error rendering protocol documentation")
++            self.log.exception("Runtime error rendering protocol documentation")
 +            return "Error rendering protocol documentation. " \
 +                       "Contact your '''Trac''' administrator for details"
  
 new file mode 100644
 --- /dev/null
 +++ b/trunk/tracrpc/xml_rpc.py
-@@ -0,0 +1,154 @@
+@@ -0,0 +1,163 @@
 +# -*- coding: utf-8 -*-
 +"""
 +License: BSD
 +    <param>
 +    <value><string>= Welcome to....
 +    }}}
++
++    The following snippet illustrates how to perform authenticated calls in python.
++
++    {{{
++    >>> from xmlrpclib import ServerProxy
++    >>> p = ServerProxy('${req.abs_href.rpc().replace('://', '://%s:your_password@' % authname)}')
++    >>> p.system.getAPIVersion()
++    [1, 0, 7]
++    }}}
 +    """
 +    implements(IRPCProtocol)
 +