GNOME Bugzilla – Bug 685234
Port to python 3
Last modified: 2013-01-08 13:34:09 UTC
It seems that soon, gnome will advise every apps to upgrade to python 3. Maybe we can start this port now, like many gnome apps.
Created attachment 232199 [details] [review]
Port gnome-clocks to python3
Here is the patch, you have to add os.environ['PYTHON'] = 'python3'to your jhbuildrc to test it.
And make sure you have a python3 version of pygobject.
Review of attachment 232199 [details] [review]:
Hi Mael! Thanks for the patch, it looks pretty good... I think we miss a couple of things
- we need a py3 version of pycanberra, there is a patch/fork on the github project and we can use that one
- I think we can just put /bin/env python3 in the hashbang instead of having to export the env var
Hi ! :)
You are right,
I kinda was hoping that libcanberra would be ported to gobject-inrospection by the time but i can see i was wrong :(
I will apply the pycanberra patch to test it out.
The exported env var was also for jhbuild, so it can install everything in the right place. Of course /bin/env python3 would be better.
Created attachment 232630 [details] [review]
I committed the updated pycanberra since that also works with py2.
Then I updated the patch and tested, but there are still a few things that do not work:
- To run in jhbuild, you need to export PYTHON because jhbuild uses that to set PYTHONPATH appropriately
- I get "TypeError: Couldn't find conversion for foreign struct 'cairo.Context'" and the drawing does not work
- I fixed the utf8 json handling for loading the files, but probably file saving needs to fixed too
the cairo error seems gone now that I rebuilt things cleanly. So I fixed up the file handling and pushed. Thanks!