Fix qute://backend-warning issues

We now set a title correctly, and don't crash if we find a Debian/Ubuntu without
version.
This commit is contained in:
Florian Bruhin 2017-06-19 13:37:00 +02:00
parent bef372e5f5
commit 40b949364e
2 changed files with 15 additions and 6 deletions

View File

@ -440,5 +440,6 @@ def qute_backend_warning(_url):
html = jinja.render('backend-warning.html',
distribution=version.distribution(),
Distribution=version.Distribution,
version=pkg_resources.parse_version)
version=pkg_resources.parse_version,
title="Legacy backend warning")
return 'text/html', html

View File

@ -39,9 +39,15 @@ the <span class="mono">qute://settings</span> page or caret browsing).</span>
If you know more, please <a href="https://github.com/qutebrowser/qutebrowser/issues/new">open an issue</a>!
{%- endmacro %}
{% macro unknown_system() -%}
There's no information available for your system. {{ please_open_issue() }}
{%- endmacro %}
<p>
{% if distribution.parsed == Distribution.ubuntu %}
{% if distribution.version >= version('17.04') %}
{% if distribution.version == none %}
{{ unknown_system() }}
{% elif distribution.version >= version('17.04') %}
{{ install_webengine('python3-pyqt5.qtwebengine') }}
{% elif distribution.version >= version('16.04') %}
QtWebEngine is only available in Ubuntu's repositories since 17.04, but you can <a href="https://github.com/qutebrowser/qutebrowser/blob/master/INSTALL.asciidoc#installing-qutebrowser-with-tox">install qutebrowser via tox</a> with <span class="mono">tox -e mkvenv-pypi</span> to use the new backend.
@ -49,7 +55,9 @@ the <span class="mono">qute://settings</span> page or caret browsing).</span>
Unfortunately, no easy way is known to install QtWebEngine on Ubuntu &lt; 16.04. {{ please_open_issue() }}
{% endif %}
{% elif distribution.parsed == Distribution.debian %}
{% if distribution.version >= version('9') %}
{% if distribution.version == none %}
{{ unknown_system() }}
{% elif distribution.version >= version('9') %}
{{ install_webengine('python3-pyqt5.qtwebengine') }}
{% else %}
Unfortunately, no easy way is known to install QtWebEngine on Debian &lt; 9. {{ please_open_issue() }}
@ -63,7 +71,7 @@ the <span class="mono">qute://settings</span> page or caret browsing).</span>
{% elif distribution.parsed == Distribution.opensuse %}
{{ install_webengine('libqt5-qtwebengine') }}
{% else %}
There's no information available for your system. {{ please_open_issue() }}
{{ unknown_system() }}
{% endif %}
</p>
@ -72,7 +80,7 @@ the <span class="mono">qute://settings</span> page or caret browsing).</span>
<span class="note">This is a drop-in replacement for legacy QtWebKit.</span>
<p>
{% if distribution.parsed == Distribution.debian and distribution.version >= version('9') %}
{% if distribution.parsed == Distribution.debian and distribution.version != none and distribution.version >= version('9') %}
There are unofficial QtWebKit-NG packages <a href="http://repo.paretje.be/unstable/">available</a>.
{% elif distribution.parsed in [Distribution.ubuntu, Distribution.debian] %}
No easy way is known to install QtWebKit-NG on your system.
@ -83,7 +91,7 @@ the <span class="mono">qute://settings</span> page or caret browsing).</span>
{% elif distribution.parsed == Distribution.gentoo %}
There's an unofficial <a href="https://gist.github.com/annulen/309569fb61e5d64a703c055c1e726f71">ebuild</a> available.
{% else %}
There's no information available for your system. {{ please_open_issue() }}
{{ unknown_system() }}
{% endif %}
</p>