Merge branch 'Kingdread-download-page'

This commit is contained in:
Florian Bruhin 2015-12-04 07:11:16 +01:00
commit 0a6c82d071
2 changed files with 6 additions and 5 deletions

View File

@ -103,6 +103,7 @@ The following software and libraries are required to run qutebrowser:
* http://pyyaml.org/wiki/PyYAML[PyYAML]
The following libraries are optional and provide a better user experience:
* http://cthedot.de/cssutils/[cssutils]
To generate the documentation for the `:help` command, when using the git

View File

@ -30,6 +30,7 @@ import email.policy
import email.generator
import email.encoders
import email.mime.multipart
import email.message
from PyQt5.QtCore import QUrl
@ -205,11 +206,10 @@ class MHTMLWriter:
return self._create_file(root_file)
def _create_file(self, f):
"""Return the single given file as MIMEMultipart."""
msg = email.mime.multipart.MIMEMultipart()
"""Return the single given file as email.message.Message."""
msg = email.message.Message()
msg['MIME-Version'] = '1.0'
msg['Content-Location'] = f.content_location
# Get rid of the default type multipart/mixed
del msg['Content-Type']
if f.content_type:
msg.set_type(f.content_type)
msg.set_payload(f.content)
@ -475,7 +475,7 @@ def _start_download(dest, web_view):
Args:
dest: The filename where the resulting file should be saved.
win_id, tab_id: Specify the tab whose page should be loaded.
web_view: Specify the webview whose page should be loaded.
"""
loader = _Downloader(web_view, dest)
loader.run()