Skip to content

Rework the way we make pycanberra optional

Mathieu Bridon requested to merge pycanberra into master

Created by: bochecha

We can't assume on pycanberra being available, because it's just a quick hack someone made as a workaround until libcanberra has GObject-Introspection bindings. As a result, it's not available on many operating systems.

So we have to make that optional...

I've never been super happy with that piece of code, because the engine itself had knowledge of whether pycanberra was available or not. Also, we tried importing it every time we needed to play some sound...

This change allows the engine to blissfully ignore all about the availability of pycanberra. It just assumes it's there, and when it's not, the new ibus_cangjie.canberra module gave it something that will just silently not do anything.

This simplifies the unit tests a lot as well: they can now assume that pycanberra is available, and we don't need to fiddle with an environment variable to control the execution of tests any more.

Merge request reports

Loading