fix(panctl): Allow GLib to be imported from pgi

Some distributions seem to have renamed the gi module to pgi, try to
import GLib from pgi if importing from gi fails.
This commit is contained in:
Damir Jelić 2022-02-03 11:42:37 +01:00
parent 3dd8051707
commit 86060a2f75

View File

@ -23,7 +23,12 @@ from typing import List
import attr
import click
from gi.repository import GLib
try:
from gi.repository import GLib
except ModuleNotFoundError:
from pgi.repository import GLib
from prompt_toolkit import __version__ as ptk_version
from prompt_toolkit import HTML, PromptSession, print_formatted_text
from prompt_toolkit.completion import Completer, Completion, PathCompleter