Update docs.

This commit is contained in:
Florian Bruhin 2014-11-20 06:25:01 +01:00
parent 9c180fd91b
commit 615be2a4bc
2 changed files with 17 additions and 1 deletions

View File

@ -9,6 +9,7 @@
|<<bind,bind>>|Bind a key to a command. |<<bind,bind>>|Bind a key to a command.
|<<cancel-download,cancel-download>>|Cancel the first/[count]th download. |<<cancel-download,cancel-download>>|Cancel the first/[count]th download.
|<<close,close>>|Close the current window. |<<close,close>>|Close the current window.
|<<download,download>>|Download a given URL, given as string.
|<<download-page,download-page>>|Download the current page. |<<download-page,download-page>>|Download the current page.
|<<forward,forward>>|Go forward in the history of the current tab. |<<forward,forward>>|Go forward in the history of the current tab.
|<<help,help>>|Show help about a command or setting. |<<help,help>>|Show help about a command or setting.
@ -88,6 +89,16 @@ The index of the download to cancel.
=== close === close
Close the current window. Close the current window.
[[download]]
=== download
Syntax: +:download 'url' ['dest']+
Download a given URL, given as string.
==== positional arguments
* +'url'+: The URL to download
* +'dest'+: The file path to write the download to to ask.
[[download-page]] [[download-page]]
=== download-page === download-page
Download the current page. Download the current page.

View File

@ -390,7 +390,12 @@ class DownloadManager(QAbstractListModel):
@cmdutils.register(instance='download-manager', scope='window') @cmdutils.register(instance='download-manager', scope='window')
def download(self, url, dest=None): def download(self, url, dest=None):
"""Download a given URL, given as string.""" """Download a given URL, given as string.
Args:
url: The URL to download
dest: The file path to write the download to, or None to ask.
"""
url = urlutils.qurl_from_user_input(url) url = urlutils.qurl_from_user_input(url)
urlutils.raise_cmdexc_if_invalid(url) urlutils.raise_cmdexc_if_invalid(url)
self.get(url, filename=dest) self.get(url, filename=dest)