You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
685B

  1. #!/usr/bin/env python
  2. """Test imports needed by X11-based tools."""
  3. from __future__ import print_function
  4. import os
  5. import sys
  6. # Keep Gtk from trying to launch X11.
  7. # Pylint seems to defeat this hack, but we can live with that.
  8. os.environ['DISPLAY'] = ''
  9. # pylint: disable=unused-import,wrong-import-position
  10. import cairo
  11. import gi
  12. try:
  13. gi.require_version('Gtk', '3.0')
  14. except (AttributeError, ValueError):
  15. # Explain the reason for the exception, then reraise
  16. print('*** Need PyGObject V3 or later, and Gtk3 ***', file=sys.stderr)
  17. raise
  18. from gi.repository import GObject
  19. from gi.repository import Gtk
  20. from gi.repository import Gdk
  21. from gi.repository import Pango