From 6133ffeb7a47a12afff2e7eb404434d24ddc01e1 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Sun, 29 Mar 2020 09:53:03 -0700 Subject: [PATCH 1/1] use either PyGObject (import gi, maintained) or pgi (import pgi, old/unmaintained) ping #7 --- gp-saml-gui.py | 11 ++++++++++- requirements.txt | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gp-saml-gui.py b/gp-saml-gui.py index 54d14c2..d6f8f15 100755 --- a/gp-saml-gui.py +++ b/gp-saml-gui.py @@ -1,6 +1,15 @@ #!/usr/bin/env python3 -import gi +try: + import gi +except ImportError: + try: + import pgi as gi + except ImportError: + gi = None +if gi is None: + raise ImportError("Either gi (PyGObject) or pgi module is required.") + import argparse import pprint import urllib diff --git a/requirements.txt b/requirements.txt index 6279bc3..80ea7da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ requests -pgi +pygobject -- 2.39.5