From 5f89f5239e74c78d0f543c40985438fca41cde47 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 23 Jul 2009 00:24:07 +0000 Subject: [PATCH] add autodoc for ui.common fix some docstrings in the json_api module --- deluge/ui/web/json_api.py | 27 +++++++++++++++++---------- docs/source/modules/ui/common.rst | 5 +++++ 2 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 docs/source/modules/ui/common.rst diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index 7b28fb180..b1eb94b36 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -97,7 +97,7 @@ class JSONException(Exception): class JSON(resource.Resource, component.Component): """ - A Twisted Web resource that exposes a JSON-RPC interface for web clients + A Twisted Web resource that exposes a JSON-RPC interface for web clients \ to use. """ @@ -469,14 +469,19 @@ class WebApi(JSONComponent): :param filename: the path to the torrent :type filename: string - :returns: - { - "filename": the torrent file - "name": the torrent name - "size": the total size of the torrent - "files": the files the torrent contains - "info_hash" the torrents info_hash - } + + :returns: information about the torrent: + + :: + + { + "filename": the torrent file, + "name": the torrent name, + "size": the total size of the torrent, + "files": the files the torrent contains, + "info_hash" the torrents info_hash + } + :rtype: dictionary """ d = Deferred() @@ -492,15 +497,17 @@ class WebApi(JSONComponent): """ Add torrents by file - :param torrents: A list of dictionaries containing the torrent + :param torrents: A list of dictionaries containing the torrent \ path and torrent options to add with. :type torrents: list **Usage** + >>> json_api.web.add_torrents([{ "path": "/tmp/deluge-web/some-torrent-file.torrent", "options": {"download_path": "/home/deluge/"} }]) + """ for torrent in torrents: filename = os.path.basename(torrent["path"]) diff --git a/docs/source/modules/ui/common.rst b/docs/source/modules/ui/common.rst new file mode 100644 index 000000000..da50350b1 --- /dev/null +++ b/docs/source/modules/ui/common.rst @@ -0,0 +1,5 @@ +:mod:`deluge.ui.common` +==================== + +.. automodule:: deluge.ui.common + :members: