mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 14:38:38 +00:00
add autodoc for ui.common
fix some docstrings in the json_api module
This commit is contained in:
parent
94891cb1f6
commit
5f89f5239e
2 changed files with 22 additions and 10 deletions
|
@ -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"])
|
||||||
|
|
5
docs/source/modules/ui/common.rst
Normal file
5
docs/source/modules/ui/common.rst
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
:mod:`deluge.ui.common`
|
||||||
|
====================
|
||||||
|
|
||||||
|
.. automodule:: deluge.ui.common
|
||||||
|
:members:
|
Loading…
Add table
Add a link
Reference in a new issue