[Reportbug-commits] [reportbug] 03/09: gtk2_ui: without graphical display, fall back to text UI
Sandro Tosi
morph at moszumanska.debian.org
Sun Feb 12 17:13:06 UTC 2017
This is an automated email from the git hooks/post-receive script.
morph pushed a commit to branch master
in repository reportbug.
commit 272e9d21b1c0ca162dfabe2e5f17cc1ad56fe368
Author: Nis Martensen <nis.martensen at web.de>
Date: Wed Feb 1 23:28:51 2017 +0100
gtk2_ui: without graphical display, fall back to text UI
---
reportbug/ui/gtk2_ui.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index f60a1eb..5395c4b 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -22,6 +22,10 @@
from reportbug.exceptions import UINotImportable
+import os
+if not ('DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ):
+ raise UINotImportable('No graphical display detected, falling back to text UI.')
+
try:
import gi
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git
More information about the Reportbug-commits
mailing list