From 4d957e6ed6c69287ab48f869961f8d8aeeb8c689 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Thu, 9 Oct 2014 14:54:13 +0200 Subject: [PATCH] Extend some docstrings with useful information This patch extends some of the docstrings in the `Client` class with more useful information. The patch also adds `intersphinx` to allow for linking to other docs within zaqarclient. For example: :rtype: :class:`zaqarclient.transport.base.Transport` will link to the documentation for Transport if it has been generated. Change-Id: I928d63d74739e9e18709979e79c95b5606d97032 --- doc/source/conf.py | 1 + zaqarclient/queues/v1/client.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8d164341..861b1a0e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -32,6 +32,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.graphviz', 'oslosphinx', ] diff --git a/zaqarclient/queues/v1/client.py b/zaqarclient/queues/v1/client.py index 7f630aa4..31cf6106 100644 --- a/zaqarclient/queues/v1/client.py +++ b/zaqarclient/queues/v1/client.py @@ -61,7 +61,7 @@ class Client(object): :param request: The request to use to load the transport instance. - :type request: `transport.request.Request` + :type request: :class:`zaqarclient.transport.request.Request` """ trans = transport.get_transport_for(request, @@ -80,7 +80,10 @@ class Client(object): return req, trans def transport(self): - """Gets a transport based the api url and version.""" + """Gets a transport based the api url and version. + + :rtype: :class:`zaqarclient.transport.base.Transport` + """ return transport.get_transport_for(self.api_url, self.api_version) @@ -113,6 +116,10 @@ class Client(object): def follow(self, ref): """Follows ref. + This method instanciates a new request instance and requests + `ref`. It is intended to be used to follow a reference href + gotten from `links` sections in responses like queues' lists. + :params ref: The reference path. :type ref: `six.text_type` """