refactor(dbus): Fix typo and remove unused thread instance
Corrected a typo in the `timeout` parameter name in `method_await_reset` and removed an unused thread instance `th_sleep` from `dbus_helper.py`. These changes improve code clarity and eliminate redundant components.
This commit is contained in:
@@ -44,10 +44,11 @@ def method_reset():
|
|||||||
log.info("ResetDriver called via D-Bus")
|
log.info("ResetDriver called via D-Bus")
|
||||||
|
|
||||||
|
|
||||||
def method_await_reset(timout: int = 0):
|
def method_await_reset(timeout: int = 0):
|
||||||
detected_signal = await_signal(
|
detected_signal = await_signal(
|
||||||
"NotifyDriverReset",
|
"NotifyDriverReset",
|
||||||
timout, extend_interface("picontrol"),
|
timeout,
|
||||||
|
extend_interface("picontrol"),
|
||||||
bus_type=BusType.SESSION if pi.pargs.use_session_bus else BusType.SYSTEM,
|
bus_type=BusType.SESSION if pi.pargs.use_session_bus else BusType.SYSTEM,
|
||||||
)
|
)
|
||||||
if detected_signal:
|
if detected_signal:
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ def await_signal(
|
|||||||
detected_signal = False
|
detected_signal = False
|
||||||
timeout = int(timeout)
|
timeout = int(timeout)
|
||||||
loop = GLib.MainLoop()
|
loop = GLib.MainLoop()
|
||||||
th_sleep = Thread()
|
|
||||||
|
|
||||||
def th_timeout():
|
def th_timeout():
|
||||||
sleep(timeout)
|
sleep(timeout)
|
||||||
|
|||||||
Reference in New Issue
Block a user