diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-04-21 09:50:07 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-04-21 09:50:07 +0200 |
commit | d07773784006337388ad6ab9bf45ac743b95d9ec (patch) | |
tree | f94688b67b8d67174ce226ec0b431ab50615cc92 | |
parent | 0fec91584dd9b399a9c2e85cc7b18316a2984e43 (diff) | |
download | qutebrowser-d07773784006337388ad6ab9bf45ac743b95d9ec.tar.gz qutebrowser-d07773784006337388ad6ab9bf45ac743b95d9ec.zip |
Improve dictcli.py error output
See #5367
-rwxr-xr-x | scripts/dictcli.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/dictcli.py b/scripts/dictcli.py index 3676506e1..2f1f369b0 100755 --- a/scripts/dictcli.py +++ b/scripts/dictcli.py @@ -38,6 +38,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) from qutebrowser.browser.webengine import spell from qutebrowser.config import configdata from qutebrowser.utils import standarddir, utils +from scripts import utils as scriptutils API_URL = 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git/+/master/' @@ -219,7 +220,13 @@ def install(languages): print('Installing {}: {}'.format(lang.code, lang.name)) install_lang(lang) except PermissionError as e: - sys.exit(str(e)) + msg = ("\n{}\n\nWith Qt < 5.10, you will need to run this script " + "as root, as dictionaries need to be installed " + "system-wide. If your qutebrowser uses a newer Qt version " + "via a virtualenv, make sure you start this script with " + "the virtualenv's Python.".format(e)) + scriptutils.print_col(msg, 'red') + sys.exit(1) def update(languages): |