test: Python import cleanup
Some test scripts use "from gi.repository import GObject" whereas others
use "import gobject". gi.repository is not always available on embedded
systems, so convert all instances to this format:
try:
from gi.repository import GObject
except ImportError:
import gobject as GObject
Also, sort the imports in this order: system, dbus, gobject, bluezutils
diff --git a/test/test-hfp b/test/test-hfp
index 873de0a..a806043 100755
--- a/test/test-hfp
+++ b/test/test-hfp
@@ -2,16 +2,18 @@
from __future__ import absolute_import, print_function, unicode_literals
-from gi.repository import GObject
-
+from optparse import OptionParser, make_option
import os
+from socket import SOCK_SEQPACKET, socket
import sys
import dbus
-import glib
import dbus.service
import dbus.mainloop.glib
-from optparse import OptionParser, make_option
-from socket import SOCK_SEQPACKET, socket
+import glib
+try:
+ from gi.repository import GObject
+except ImportError:
+ import gobject as GObject
mainloop = None
audio_supported = True