rilmodem/ofono — pull request #56 by martinpitt (2014-02-25 14:48:01+00:00)
Title: Port ofono test scripts to also work with Python3

We are in the process of eliminating Python 2 from our images, and thus I ported the ofono test scripts to Python 3.

The first three patches keep the current behaviour and just make the scripts bilingual, i. e. they will work with both Python >= 2.6 and Python 3. They are rather big, but mostly mechanical (2to3 with some overzealous bits removed, and cleaning up some print statements).

Patch 4 moves the scripts from the ancient and long-unmaintained static gobject bindings to gobject-introspection. That's available for both python 2 and 3.

Patch 5 does the remaining bits (unicode and raw_input) and is currently *not* bilingual. Please do not apply it as-is unless you want the scripts to only work with Python 3. It is mostly an FYI, if you generally agree to doing this conversion I'm happy to change it to a form where it works with both Python versions. But that's more involved and it's work that I would only do after getting your "yes, we'll take it" confirmation. :-)

I tested most of these scripts with phonesim with python 2 and 3 and they work well. I also ran pyflakes over them.

Note that I originally did these patches against
http://git.kernel.org/cgit/network/ofono/ofono.git and sent them to ofono@ofono.org (in lack of a proper upstream bug tracker). The commits here are a backport to the older version, plus an extension of the port to test/rilmodem/.