> reportbug should fallback to the text ui if run from a text console.

Here is a patch that implements this.

Regards, Nis
>From a2da701d8f1fa1a5b33392a6ee8b4d16171466ce Mon Sep 17 00:00:00 2001
From: Nis Martensen <nis.marten...@web.de>
Date: Wed, 1 Feb 2017 23:28:51 +0100
Subject: [PATCH 4/4] 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 3d74a7a..23d598b 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
 
-- 
2.1.4

_______________________________________________
Reportbug-maint mailing list
Reportbug-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint

Reply via email to