[Core] Cleanup a few docstrings in TM

This commit is contained in:
Calum Lind 2015-10-02 19:29:10 +01:00
parent e4ec248eb6
commit dd3aeb45ea
1 changed files with 9 additions and 7 deletions

View File

@ -271,9 +271,7 @@ class TorrentManager(component.Component):
filepath (str): The filepath to extract torrent info from. filepath (str): The filepath to extract torrent info from.
Returns: Returns:
lt.torrent_info : A libtorrent torrent_info dict. lt.torrent_info : A libtorrent torrent_info dict or None if invalid file or data.
Returns None if file or data are not valid
""" """
# Get the torrent data from the torrent file # Get the torrent data from the torrent file
if log.isEnabledFor(logging.DEBUG): if log.isEnabledFor(logging.DEBUG):
@ -300,9 +298,10 @@ class TorrentManager(component.Component):
resume_data (lt.entry, optional): libtorrent fast resume data. resume_data (lt.entry, optional): libtorrent fast resume data.
Returns: Returns:
str: The torrent_id of the added torrent. str: If successful the torrent_id of the added torrent, None if adding the torrent failed.
Returns None if adding was unsuccessful. Emits:
TorrentAddedEvent: Torrent with torrent_id added to session.
""" """
if torrent_info is None and filedump is None and magnet is None: if torrent_info is None and filedump is None and magnet is None:
@ -449,6 +448,10 @@ class TorrentManager(component.Component):
Returns: Returns:
bool: True if removed successfully, False if not. bool: True if removed successfully, False if not.
Emits:
PreTorrentRemovedEvent: Torrent is about to be removed from session.
TorrentRemovedEvent: Torrent with torrent_id removed from session.
Raises: Raises:
InvalidTorrentError: If the torrent_id is not in the session. InvalidTorrentError: If the torrent_id is not in the session.
@ -686,8 +689,7 @@ class TorrentManager(component.Component):
issue with file timestamps, defaults to False. This is only needed when stopping the session. issue with file timestamps, defaults to False. This is only needed when stopping the session.
Returns: Returns:
t.i.d.DeferredList: A list of twisted Deferred callbacks that will t.i.d.DeferredList: A list of twisted Deferred callbacks to be invoked when save is complete.
be invoked when save is complete.
""" """
if torrent_ids is None: if torrent_ids is None: