caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
10.94k stars 385 forks source link

Replace dbus-python #984

Open qarkai opened 8 months ago

qarkai commented 8 months ago

:bulb: The Idea According to https://www.freedesktop.org/wiki/Software/DBusBindings dbus-python is obsolete, recommended libraries are pydbus, txdbus or GDBus/QtDBus bindings. Since project is platform-independent it seems that most appropriate replacement is pydbus.

qarkai commented 8 months ago

Well, it seems that pydbus is unmaintained. There are other options, see https://wiki.python.org/moin/DbusExamples

caronc commented 8 months ago

I guess dasbus is the ideal solution since we don't support Python v2 or anything less then v3.6 anyway? Not sure how easy it is to adopt and/or blend with all the distributions.

I can investigate what is required, but this will be rather low priority as even the obsolete method works great right now. I respect the need to keep the libraries current so we don't run into any deprication problems in the future though.

qarkai commented 8 months ago

dasbus is quite modern, old distros don't have it, but major distros (CentOS, Debian, Fedora, OpenSUSE, Rocky) have packages, see https://repology.org/project/dasbus/versions and https://repology.org/project/python:dasbus/versions.

dasbus itself depends on PyGObject. Probably it makes more sense to use GDBus via PyGObject directly.

qarkai commented 8 months ago

I was able to port dbus plugin to Gio/GLib, but not sure how to fix tests. I can create draft PR with my patches.

caronc commented 8 months ago

I think it's great that you've got something going. create a PR and i can try to help with the testing.

I feel that the old way should be still available (so your new way should introduce a an alternative, but not a replacement).

I see NotifyDBus.py being moved to /NotifyDBus/v1.py (or something like that), and your code going in NotifyDBus/v2.py with a __init__.py tying the two together and making up the bulk of the old NotifyDBus.py library.

does that make sense? I can help with some of this if you have some working v2 code. ... we'll default a new attribute called version to 2' but still allow people to do version=1 to be backwards compatible.

Perhaps this is overkill too; this will be easier to decide once you share your solution :slightly_smiling_face: