From 0980d58415611bf88ad000f8c0e10be3daf53a98 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 22 Jul 2020 21:35:27 +0300 Subject: [PATCH 1/2] Port set_pidgin_buddyicon_dbus to GDBus --- mugshot/MugshotWindow.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mugshot/MugshotWindow.py b/mugshot/MugshotWindow.py index 689a5ce..f73631b 100644 --- a/mugshot/MugshotWindow.py +++ b/mugshot/MugshotWindow.py @@ -23,10 +23,9 @@ import os import shutil import subprocess -import dbus import pexpect -from gi.repository import Gtk, GdkPixbuf, GLib # pylint: disable=E0611 +from gi.repository import Gio, Gtk, GdkPixbuf, GLib # pylint: disable=E0611 from mugshot_lib import Window, SudoDialog, AccountsServiceAdapter, helpers @@ -466,14 +465,15 @@ class MugshotWindow(Window): def set_pidgin_buddyicon_dbus(self, filename=None): """Set the pidgin buddy icon via dbus.""" logger.debug('Updating pidgin buddy icon via dbus') - bus = dbus.SessionBus() - obj = bus.get_object("im.pidgin.purple.PurpleService", - "/im/pidgin/purple/PurpleObject") - purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") + bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) + purple = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, + "im.pidgin.purple.PurpleService", + "/im/pidgin/purple/PurpleObject", + "im.pidgin.purple.PurpleInterface", None) # To make the change instantly visible, set the icon to none first. - purple.PurplePrefsSetPath('/pidgin/accounts/buddyicon', '') + purple.PurplePrefsSetPath('(ss)', '/pidgin/accounts/buddyicon', '') if filename: - purple.PurplePrefsSetPath('/pidgin/accounts/buddyicon', filename) + purple.PurplePrefsSetPath('(ss)', '/pidgin/accounts/buddyicon', filename) def set_pidgin_buddyicon_xml(self, filename=None): """Set the buddyicon used by pidgin to filename (via the xml file).""" From e07c14666ee2bca1421ade8fb011ac209b740fc3 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 22 Jul 2020 21:37:34 +0300 Subject: [PATCH 2/2] Remove python3-dbus from dependencies --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 2ff0089..af5335c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ ### Build Requirements - gir1.2-gtk-3.0 - python3 - - python3-dbus - python3-distutils - [python3-distutils-extra](https://launchpad.net/python-distutils-extra) - python3-gi @@ -23,7 +22,6 @@ ### Runtime Requirements - chfn - python3-cairo - - python3-dbus - python3-gi - python3-pexpect