chore: remove depreciated dependency pydbus for dasbus

This commit is contained in:
Hank Greenburg 2024-10-01 19:14:39 -07:00
parent 3968c69aa8
commit 634ac7ed68
3 changed files with 17 additions and 17 deletions

View File

@ -34,7 +34,7 @@ from prompt_toolkit import HTML, PromptSession, print_formatted_text
from prompt_toolkit.completion import Completer, Completion, PathCompleter from prompt_toolkit.completion import Completer, Completion, PathCompleter
from prompt_toolkit.document import Document from prompt_toolkit.document import Document
from prompt_toolkit.patch_stdout import patch_stdout from prompt_toolkit.patch_stdout import patch_stdout
from pydbus import SessionBus from dasbus.connection import SessionMessageBus
PTK2 = ptk_version.startswith("2.") PTK2 = ptk_version.startswith("2.")
@ -404,8 +404,8 @@ class PanCtl:
commands = list(command_help.keys()) commands = list(command_help.keys())
def __attrs_post_init__(self): def __attrs_post_init__(self):
self.bus = SessionBus() self.bus = SessionMessageBus()
self.pan_bus = self.bus.get("org.pantalaimon1") self.pan_bus = self.bus.get_connection("org.pantalaimon1")
self.ctl = self.pan_bus["org.pantalaimon1.control"] self.ctl = self.pan_bus["org.pantalaimon1.control"]
self.devices = self.pan_bus["org.pantalaimon1.devices"] self.devices = self.pan_bus["org.pantalaimon1.devices"]

View File

@ -17,7 +17,7 @@ from importlib import util
UI_ENABLED = ( UI_ENABLED = (
util.find_spec("gi") is not None util.find_spec("gi") is not None
and util.find_spec("gi.repository") is not None and util.find_spec("gi.repository") is not None
and util.find_spec("pydbus") is not None and util.find_spec("dasbus") is not None
) )
if UI_ENABLED: if UI_ENABLED:
@ -28,8 +28,8 @@ if UI_ENABLED:
import dbus import dbus
import notify2 import notify2
from gi.repository import GLib from gi.repository import GLib
from pydbus import SessionBus from dasbus import SessionMessageBus
from pydbus.generic import signal from dasbus.signal import Signal
from dbus.mainloop.glib import DBusGMainLoop from dbus.mainloop.glib import DBusGMainLoop
from nio import RoomKeyRequest, RoomKeyRequestCancellation from nio import RoomKeyRequest, RoomKeyRequestCancellation
@ -123,8 +123,8 @@ if UI_ENABLED:
</node> </node>
""" """
Response = signal() Response = Signal()
UnverifiedDevices = signal() UnverifiedDevices = Signal()
def __init__(self, queue, server_list, id_counter): def __init__(self, queue, server_list, id_counter):
self.queue = queue self.queue = queue
@ -297,13 +297,13 @@ if UI_ENABLED:
</node> </node>
""" """
VerificationInvite = signal() VerificationInvite = Signal()
VerificationCancel = signal() VerificationCancel = Signal()
VerificationString = signal() VerificationString = Signal()
VerificationDone = signal() VerificationDone = Signal()
KeyRequest = signal() KeyRequest = Signal()
KeyRequestCancel = signal() KeyRequestCancel = Signal()
def __init__(self, queue, id_counter): def __init__(self, queue, id_counter):
self.device_list = dict() self.device_list = dict()
@ -466,8 +466,8 @@ if UI_ENABLED:
self.control_if = Control(self.send_queue, self.server_list, id_counter) self.control_if = Control(self.send_queue, self.server_list, id_counter)
self.device_if = Devices(self.send_queue, id_counter) self.device_if = Devices(self.send_queue, id_counter)
self.bus = SessionBus() self.bus = SessionMessageBus()
self.bus.publish("org.pantalaimon1", self.control_if, self.device_if) self.bus.publish_object("org.pantalaimon1", self.control_if, self.device_if)
def unverified_notification(self, message): def unverified_notification(self, message):
notification = notify2.Notification( notification = notify2.Notification(

View File

@ -35,7 +35,7 @@ setup(
"ui": [ "ui": [
"dbus-python >= 1.2, < 1.3", "dbus-python >= 1.2, < 1.3",
"PyGObject >= 3.36, < 3.39", "PyGObject >= 3.36, < 3.39",
"pydbus >= 0.6, < 0.7", "dasbus == 1.71",
"notify2 >= 0.3, < 0.4", "notify2 >= 0.3, < 0.4",
] ]
}, },