GNOME Music’s Python Port Can’t Be This Great!

Yes, gnome-music is ported again, and this time, it’s to Python.

We ported GNOME Music because  we can’t debug, we can’t profile it, there’s not enough documentation, we can’t use threads, no coding style checker, and some other things we can’t do with GJS.

All of the active developers and code contributors present when we talked about the port has experience working with Python (I’m the least experienced in Python though), and everyone in that said time agreed to port to it.

We started the port around July 12. We set up a repository for the port in GitHub ( then everyone created a pull request once they are finished working on something.

Vadim Rutkovsky added a service hook to Travis CI to make sure the code follows the coding style. Eslam Mostafa started the porting of some of the sources, then others started porting the remaining files afterwards. I worked on the porting of albumArtCache (partially), query and grilo modules.

I haven’t slept during the time between July 12 and July 13, because of answering some problem sets (school work) and porting to Python. That’s the first time I went to school without any sleep XD. Fortunately, I only have one class during Saturdays, but I wasn’t able to go to my part time job.

Once most of the code are ported, we started fixing the ported code to make gnome-music running again. The GSoC and OPW students (Eslam Mostafa, Shivani Poddar and Sai Suman Prayaga) worked on the JavaScript code first to fix the blocker bugs for GNOME 3.10 cycle while the rest of the team worked on the bugs. Manish Sinha joined us too and fixed the build system.

Most of the fixing on the ported code are done by Vadim and Seif Lotfy, then when gnome-music finally runs again, the students joined us too and started porting their bug fixes to Python.

Then finally, on July 24, Ignacio Casal Quinteiro merged our work to GNOME’s Git repository.

The result? GNOME Music is now more stable and faster! We used profilers to find the parts where a lot of memory and/or time is being wasted. The code now is easier to read too.

The only problems I encountered (and I could remember :D) while porting to Python is that the lambda’s are one liners only and GDBus in PyGObject doesn’t support DBus servers yet. I used python3-dbus (or also known as dbus-python, etc.) to be able to port MPRIS, and separated the methods to a new module.

Of course, Vala is still my favorite programming language :P.

Thanks to Vadim Rutkovsky, Seif Lotfy and Guillaume Quintard for teaching me a lot of things about Python and cleaning up the mess I made :D.

Anyway, this post is getting too long, I’ll just blog the other things next time! 😀

Finally, this post got published, it waited for a month to be published…


One thought on “GNOME Music’s Python Port Can’t Be This Great!”

  1. While I understand the reasoning of the port, I feel bad that gnome’s prefered language doesn’t seem to be up to the task of writing a moderately complex app and doesn’t have the right tools 😦

    Anyway, good job!

Blog is now moved to, please leave your comments there instead.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s