ctjacobs / pyqso

PyQSO is a contact logging tool for amateur radio operators.
http://christianjacobs.uk/pyqso
GNU General Public License v3.0
79 stars 19 forks source link

Convert to python 3 #34

Closed njohnsn closed 8 years ago

njohnsn commented 8 years ago

I was able to convert your code to python 3. Converting the code was simply a matter of running 2to3. The hardest part was getting it to build and test on travis-ci.

Ubuntu Python 3 binding packages for python-libhamlib2 and and python-mpltoolkits.basemap have not been created by the package maintainers. I was able to "build" against hamlib3 manually on a Ubuntu VM.

Do with this whatever you wish. It was just an exercise for me in Python 3, GitHub, and Travis-CI

Regards.

-Neil

ctjacobs commented 8 years ago

Thank you very much for this contribution Neil! I'll take a closer look at your modifications soon.

ctjacobs commented 8 years ago

Just tried running the 2to3 branch on a virtual machine with Ubuntu 15.10 installed. I was getting the following warning when running PyQSO with Python 3.4:

/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py:18: UserWarning: The Gtk3Agg backend is known to not work on Python 3.x with pycairo. Try installing cairocffi.

Trying to display the grey line tool yields

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 69, in on_draw_event
    buf, cairo.FORMAT_ARGB32, width, height)
NotImplementedError: Surface.create_for_data: Not Implemented yet.

But after installing the libxcb-render0-dev and python3-cairocffi packages the grey line tool works fine. The following packages are also available to satisfy the other dependencies: python3-numpy, python3-matplotlib, python3-mpltoolkits.basemap.

ctjacobs commented 8 years ago

The diff is a bit hard to read - pretty much every line shows up as modified because of CR/LF character differences. Also, some usernames will need to be changed back (e.g. in the Travis build status link) post merge. I'll run dos2unix on each file to change back to Unix-style, make any final changes locally and then merge the changes in.

ctjacobs commented 8 years ago

Changes merged manually. I squashed all of your commits into one (fc94c8d511a737a7c9f09cccb09b6b4cfbc666ca) to keep the Git history tidy.

I'm in contact with Iain from the Debian packaging team regarding a Python 3-compatible package for Hamlib.

Thank you! 73s.