From 3b2ae6bcf16c650269ea697a38b9aa4283f8e21c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 9 May 2014 06:57:44 +0200 Subject: [PATCH] Add warning for dead_actute warning. Yo dawg, I herd you like warnings! --- qutebrowser/app.py | 4 +++- qutebrowser/utils/misc.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 03bd581d0..e2ec19048 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -65,7 +65,8 @@ from qutebrowser.config.iniparsers import ReadWriteConfigParser from qutebrowser.config.lineparser import LineConfigParser from qutebrowser.browser.cookies import CookieJar from qutebrowser.utils.message import MessageBridge -from qutebrowser.utils.misc import dotted_getattr, get_standard_dir +from qutebrowser.utils.misc import (dotted_getattr, get_standard_dir, + actute_warning) from qutebrowser.utils.debug import set_trace # pylint: disable=unused-import @@ -122,6 +123,7 @@ class QuteBrowser(QApplication): self._args = self._parse_args() self._init_log() self._init_misc() + actute_warning() self._init_config() self._init_modes() websettings.init() diff --git a/qutebrowser/utils/misc.py b/qutebrowser/utils/misc.py index 590332dd8..83e90f03c 100644 --- a/qutebrowser/utils/misc.py +++ b/qutebrowser/utils/misc.py @@ -155,3 +155,18 @@ def get_standard_dir(typ): if not os.path.exists(path): os.makedirs(path) return path + + +def actute_warning(): + """Display a warning about the dead_actute issue if needed.""" + if not (sys.platform.startswith('linux') and + os.path.exists('/usr/share/X11/locale/en_US.UTF-8/Compose')): + return + with open('/usr/share/X11/locale/en_US.UTF-8/Compose', 'r') as f: + for line in f: + if '' in line: + print("Note: If you got a 'dead_actute' warning above, that " + "is not a bug in qutebrowser! See " + "https://bugs.freedesktop.org/show_bug.cgi?id=69476 for " + "details.") + break