refactor: Update type annotations
Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
"""D-Bus interfaces for IOs."""
|
||||
|
||||
from typing import Union
|
||||
|
||||
from dbus import SystemBus, SessionBus
|
||||
from pydbus.bus import Bus
|
||||
from pydbus.generic import signal
|
||||
from revpimodio2.device import Device
|
||||
|
||||
@@ -50,7 +48,7 @@ class InterfaceDevice:
|
||||
interface_name = "com.revolutionpi.ios1.Device"
|
||||
PropertiesChanged = signal()
|
||||
|
||||
def __init__(self, dbus: Union[SystemBus, SessionBus], device: Device):
|
||||
def __init__(self, dbus: Bus, device: Device):
|
||||
self.dbus = dbus
|
||||
self.device = device
|
||||
self.object_path = get_device_object_path(device)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
from typing import Union, List
|
||||
|
||||
from dbus import SystemBus, SessionBus
|
||||
from gi.overrides.GLib import Variant
|
||||
from pydbus import Variant
|
||||
from pydbus.bus import Bus
|
||||
from pydbus.generic import signal
|
||||
from revpimodio2 import RevPiModIO, Cycletools, INP, OUT
|
||||
from revpimodio2.io import IOBase
|
||||
@@ -58,7 +58,7 @@ class InterfaceInput:
|
||||
interface_name = "com.revolutionpi.ios1.Input"
|
||||
PropertiesChanged = signal()
|
||||
|
||||
def __init__(self, dbus: Union[SystemBus, SessionBus], io: IOBase):
|
||||
def __init__(self, dbus: Bus, io: IOBase):
|
||||
self._raw = False
|
||||
self.dbus = dbus
|
||||
self.io = io
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
"""Helper for dbus."""
|
||||
|
||||
from logging import getLogger
|
||||
from typing import Union
|
||||
|
||||
from pydbus import SessionBus, SystemBus
|
||||
from pydbus.bus import Bus
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
@@ -16,7 +15,7 @@ REVPI_DBUS_BASE_PATH = "/com/revolutionpi/middleware1"
|
||||
|
||||
class DbusInterface:
|
||||
|
||||
def __init__(self, bus: Union[SessionBus, SystemBus]):
|
||||
def __init__(self, bus: Bus):
|
||||
self.bus = bus
|
||||
|
||||
def cleanup(self):
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
from logging import getLogger
|
||||
|
||||
from pydbus.bus import Bus
|
||||
from pydbus.generic import signal
|
||||
|
||||
from .process_image_helper import PiControlIoctl, ResetDriverWatchdog
|
||||
@@ -27,7 +28,7 @@ class InterfacePiControl(DbusInterface):
|
||||
|
||||
NotifyDriverReset = signal()
|
||||
|
||||
def __init__(self, bus, picontrol_device: str, config_rsc: str):
|
||||
def __init__(self, bus: Bus, picontrol_device: str, config_rsc: str):
|
||||
super().__init__(bus)
|
||||
|
||||
self.picontrol_device = picontrol_device
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
from logging import getLogger
|
||||
from typing import List
|
||||
|
||||
from pydbus.bus import Bus
|
||||
from pydbus.generic import signal
|
||||
|
||||
from ..dbus_helper import DbusInterface
|
||||
@@ -48,7 +49,7 @@ class InterfaceSoftwareServices(DbusInterface):
|
||||
AvailabilityChanged = signal()
|
||||
StatusChanged = signal()
|
||||
|
||||
def __init__(self, bus):
|
||||
def __init__(self, bus: Bus):
|
||||
super().__init__(bus)
|
||||
|
||||
self.mrk_available = {}
|
||||
|
||||
Reference in New Issue
Block a user