Commits

Olemis Lang committed 6d236dd

TracRpc: Including RPC API version dynamically in docs.

Comments (0)

Files changed (1)

t5437/t5437-protocol_api-r7194.diff

 @@ -0,0 +1,13 @@
 +#rpc-toc {
 +    display: none;
-+    float: 'right' !important;
++    float: right !important;
 +    width: 15em;
 +}
 +#rpc-toc.wiki-toc h4 {
 new file mode 100644
 --- /dev/null
 +++ b/trunk/tracrpc/templates/rpc_main.html
-@@ -0,0 +1,102 @@
+@@ -0,0 +1,103 @@
 +<!DOCTYPE html
 +    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 +    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 +      <div class="wikipage searchable">
 +        <h1>Remote Procedure Call (RPC) Protocols</h1>
 +        <p>Since <i>version 1.0.7</i> it is possible to invoke 
-+          <a href="${req.abs_href.rpc('api')}">the methods available 
++          <a href="${req.abs_href.rpc() + '#Methods'}">the methods available 
 +          in your environment</a> via many different protocols. Users 
 +          can even implement another protocol in a plugin and install 
 +          it at any time.
 +        </p>
++        <p><strong>Current version :</strong> ${rpc.version} </p>
 +        <h2 id="Protocols">Protocol reference:</h2>
 +        <p>Below you will find a detailed description of all the RPC 
 +          protocols installed in this environment. This includes 
 diff --git a/trunk/tracrpc/web_ui.py b/trunk/tracrpc/web_ui.py
 --- a/trunk/tracrpc/web_ui.py
 +++ b/trunk/tracrpc/web_ui.py
-@@ -6,305 +6,140 @@
+@@ -6,305 +6,141 @@
  (c) 2009      ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no)
  """
  
 +                    {'rpc': {'functions': namespaces,
 +                      'protocols': [p.rpc_info() + (list(p.rpc_match()),) \
 +                                      for p in self.protocols],
-+                      'proto_id' : None},
++                      'proto_id' : None,
++                      'version': __import__('tracrpc', ['__version__']).__version__},
 +                    'expand_docs': self._expand_docs
 +                    },
 +                  None)
 +
 +    {{{
 +    >>> from xmlrpclib import ServerProxy
-+    >>> p = ServerProxy('${req.abs_href.rpc().replace('://', '://%s:your_password@' % authname)}')
++    >>> p = ServerProxy('${req.abs_href.login('rpc').replace('://', '://%s:your_password@' % authname)}')
 +    >>> p.system.getAPIVersion()
-+    [1, 0, 7]
++    [${', '.join(rpc.version.split('.'))}]
 +    }}}
 +    """
 +    implements(IRPCProtocol)