summaryrefslogtreecommitdiff
path: root/test_xgps_deps.py
blob: cb9448ea5178495317fc87a8ef0604741afafd4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
"""Test imports needed by X11-based tools."""

from __future__ import print_function

import os
import sys

# Keep Gtk from trying to launch X11.
# Pylint seems to defeat this hack, but we can live with that.
os.environ['DISPLAY'] = ''

# pylint: disable=unused-import,wrong-import-position

import cairo

import gi
try:
    gi.require_version('Gtk', '3.0')
except (AttributeError, ValueError):
    # Explain the reason for the exception, then reraise
    print('*** Need PyGObject V3 or later, and Gtk3 ***', file=sys.stderr)
    raise
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango