Skip to content

Commit

Permalink
refactor: Remove deprecated purge and purge_all methods from API
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Dec 14, 2019
1 parent d359451 commit 6baf63c
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/aria2p/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,43 +493,6 @@ def autopurge(self):
logger.warning("Future change warning: API method 'autopurge' will be renamed 'purge' in version 0.9.0.")
return self.client.purge_download_result()

def purge(self, downloads):
"""
Purge given downloads from the queue.
Returns:
list of bool: Success or failure of the operation for each download.
"""
# TODO: batch/multicall candidate
logger.warning(
"Deprecation warning: API method 'purge' is deprecated in favor of method 'remove', "
"and will be removed in version 0.7.0."
)
result = []

for download in downloads:
try:
self.client.remove_download_result(download.gid)
except ClientException as error:
logger.exception(error)
result.append(error)
else:
result.append(True)

return result

def purge_all(self):
"""
Purge all downloads from the list.
Returns:
bool: Success or failure of the operation to purge all downloads.
"""
logger.warning(
"Deprecation warning: API method 'purge_all' is deprecated, and will be removed in version 0.7.0."
)
return all(self.purge(self.get_downloads()))

def get_options(self, downloads):
"""
Get options for each of the given downloads.
Expand Down

0 comments on commit 6baf63c

Please sign in to comment.