IanHarvey/bluepy — pull request #6 by kalfa (2014-06-18 12:37:37+00:00)
Title: Python 3.4 amends

Hi,
those are the amends to have btle.py and sensortag.py compatible with Py3.4.
Unfortunately it's not compatible with 3.2 unless some further changes are applied, which might break 3.4.

Since 3.4 is the last stable and fixes several behaviour that were wrong in 3.2, I'd keep it as it is now.

As further work, I'll do some refactoring for a project of mine. If you're interested we can work it out together, but it will likely break the current API.

This branch is the minimum work I could contribute without breaking up the API.

I apologise, I fixed also many code style, since pylint/pep8 and other tools complained a lot. It wasn't possible for me to understand where real errors were for 3.4 and were style issue. I didn't want to change your coding style. Anyway, I suggest you to run pylint and pep8 at least against your modules and fix whatever possible, to increase readability for other python developers out there :smile:

What I'm going to do next:
I need to split classes up to have a suitable base class for a transport (which logic is currently included in Peripheral) and the logic which will use it (sometimes called Protocol), which is spread all over other classes and is also in Peripheral as well. I need a clear cut on class roles and responsibilities.

It needs it to work on a async framework, in my case asyncio (this is why I'm interested in py3.4) but it should be usable by any other framework like tornado or twisted.

Let me know if you're interested. My plan is currently forking your work to avoid major changes to your API.