Currently we have a mix of /usr/bin/python, /usr/bin/python3 and
/usr/bin/env python3. Use the latter since is the more common way of
handling this, plus it allows people to override the system python (for
what ever reason).
Inspired by a Debian patch, doing a mass /usr/bin/python{,3} conversion.
Cc: Nobuhiro Iwamatsu <iwamatsu@debian.org>
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
test-network is no longer needed since Network interface does not have
Connect/Disconnect methods anymore and similar functionality is already
provided by test-device.
This patch makes the python tests source-compatible with python 3, while
leaving the interpreter at python 2 for now.
The tradeoff is that this source is no longer compatible with python
versions < 2.6, and requires gobject-introspection for the glib-based
tests.