]> code.communitydata.science - nu-vpn-proxy.git/commitdiff
use either PyGObject (import gi, maintained) or pgi (import pgi, old/unmaintained)
authorDaniel Lenski <dlenski@gmail.com>
Sun, 29 Mar 2020 16:53:03 +0000 (09:53 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Sun, 29 Mar 2020 16:54:24 +0000 (09:54 -0700)
ping #7

gp-saml-gui.py
requirements.txt

index 54d14c2693d502a85657f8bfa7c51c2394b2e831..d6f8f15c4bbf2a517b6daf2c3946a18e688c32f5 100755 (executable)
@@ -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
index 6279bc3f3b0ac40a3b7edc4b0da454d8a6a4da9b..80ea7da2ecc128954f75e652256a1d01f0155429 100644 (file)
@@ -1,2 +1,2 @@
 requests
-pgi
+pygobject

Community Data Science Collective || Want to submit a patch?