~dobey/ubuntuone-client/py-only

« back to all changes in this revision

Viewing changes to tests/platform/os_helper/test_linux.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2013-01-28 23:09:36 UTC
  • mfrom: (1378.1.5 no-pygtk)
  • Revision ID: tarmac-20130128230936-1k8aksvh4vlyzyi5
Remove most of the remaining support for older static glib bindings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# tests.platform.linux - linux platform tests
2
 
#
3
 
# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
4
 
#
5
 
# Copyright 2010-2012 Canonical Ltd.
 
1
# Copyright 2010-2013 Canonical Ltd.
6
2
#
7
3
# This program is free software: you can redistribute it and/or modify it
8
4
# under the terms of the GNU General Public License version 3, as published
32
28
 
33
29
import logging
34
30
import os
35
 
import sys
36
31
 
37
 
if 'gobject' in sys.modules and sys.modules['gobject'] is not None:
 
32
try:
 
33
    from gi.repository import Gio as gio
 
34
    GIO_NOT_SUPPORTED = gio.IOErrorEnum.NOT_SUPPORTED
 
35
except ImportError:
38
36
    import gio
39
37
    GIO_NOT_SUPPORTED = gio.ERROR_NOT_SUPPORTED
40
 
else:
41
 
    from gi.repository import Gio as gio
42
 
    GIO_NOT_SUPPORTED = gio.IOErrorEnum.NOT_SUPPORTED
43
38
 
44
39
from twisted.internet import defer
45
40
from ubuntuone.devtools.handlers import MementoHandler