add autodoc for ui.common

fix some docstrings in the json_api module
This commit is contained in:
Damien Churchill 2009-07-23 00:24:07 +00:00
commit 5f89f5239e
2 changed files with 22 additions and 10 deletions

View file

@ -97,7 +97,7 @@ class JSONException(Exception):
class JSON(resource.Resource, component.Component): 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. to use.
""" """
@ -469,14 +469,19 @@ class WebApi(JSONComponent):
:param filename: the path to the torrent :param filename: the path to the torrent
:type filename: string :type filename: string
:returns:
{ :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 "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 :rtype: dictionary
""" """
d = Deferred() d = Deferred()
@ -492,15 +497,17 @@ class WebApi(JSONComponent):
""" """
Add torrents by file 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. path and torrent options to add with.
:type torrents: list :type torrents: list
**Usage** **Usage**
>>> json_api.web.add_torrents([{ >>> json_api.web.add_torrents([{
"path": "/tmp/deluge-web/some-torrent-file.torrent", "path": "/tmp/deluge-web/some-torrent-file.torrent",
"options": {"download_path": "/home/deluge/"} "options": {"download_path": "/home/deluge/"}
}]) }])
""" """
for torrent in torrents: for torrent in torrents:
filename = os.path.basename(torrent["path"]) filename = os.path.basename(torrent["path"])

View file

@ -0,0 +1,5 @@
:mod:`deluge.ui.common`
====================
.. automodule:: deluge.ui.common
:members: