Remove long deprecated :download invocation

This commit is contained in:
Florian Bruhin 2017-12-14 09:06:46 +01:00
parent dce4c68827
commit f0ad24b08a
4 changed files with 4 additions and 26 deletions

View File

@ -142,6 +142,8 @@ Removed
- The long-deprecated `:prompt-yes`, `:prompt-no`, `:paste-primary` and `:paste`
commands have been removed.
- The invocation `:download <url> <dest>` which was deprecated in v0.5.0 was
removed, use `:download --dest <dest> <url>` instead.
- The `messages.unfocused` option which wasn't used anymore was removed.
- The `x[xtb]` default bindings got removed again as many users accidentally
triggered them.

View File

@ -334,12 +334,10 @@ Write the current configuration to a config.py file.
[[download]]
=== download
Syntax: +:download [*--mhtml*] [*--dest* 'dest'] ['url'] ['dest-old']+
Syntax: +:download [*--mhtml*] [*--dest* 'dest'] ['url']+
Download a given URL, or current page if no URL given.
The form `:download [url] [dest]` is deprecated, use `:download --dest [dest] [url]` instead.
==== positional arguments
* +'url'+: The URL to download. If not given, download the current page.

View File

@ -1425,27 +1425,14 @@ class CommandDispatcher:
raise cmdexc.CommandError(e)
@cmdutils.register(instance='command-dispatcher', scope='window')
@cmdutils.argument('dest_old', hide=True)
def download(self, url=None, dest_old=None, *, mhtml_=False, dest=None):
def download(self, url=None, *, mhtml_=False, dest=None):
"""Download a given URL, or current page if no URL given.
The form `:download [url] [dest]` is deprecated, use `:download --dest
[dest] [url]` instead.
Args:
url: The URL to download. If not given, download the current page.
dest_old: (deprecated) Same as dest.
dest: The file path to write the download to, or None to ask.
mhtml_: Download the current page and all assets as mhtml file.
"""
if dest_old is not None:
message.warning(":download [url] [dest] is deprecated - use "
":download --dest [dest] [url]")
if dest is not None:
raise cmdexc.CommandError("Can't give two destinations for the"
" download.")
dest = dest_old
# FIXME:qtwebengine do this with the QtWebEngine download manager?
download_manager = objreg.get('qtnetwork-download-manager',
scope='window', window=self._win_id)

View File

@ -242,15 +242,6 @@ Feature: Downloading things from a website.
## Wrong invocations
Scenario: :download with deprecated dest-old argument
When I run :download http://localhost:(port)/ deprecated-argument
Then the warning ":download [url] [dest] is deprecated - use :download --dest [dest] [url]" should be shown
Scenario: Two destinations given
When I run :download --dest destination2 http://localhost:(port)/ destination1
Then the warning ":download [url] [dest] is deprecated - use :download --dest [dest] [url]" should be shown
And the error "Can't give two destinations for the download." should be shown
Scenario: :download --mhtml with a URL given
When I run :download --mhtml http://foobar/
Then the error "Can only download the current page as mhtml." should be shown