Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lasers committed Dec 4, 2023
1 parent 92b76c6 commit 89407ac
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions py3status/modules/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,14 @@ def _dbus_init(self):
)

def _get_bluez_data(self):
for retry in range(0, 2):
self.py3.log(" --- RETRY {} ---".format(retry))
try:
try:
objects = self.bluez_manager.GetManagedObjects()
except GLib.Error as err:
if err.matches(Gio.dbus_error_quark(), Gio.DBusError.SERVICE_UNKNOWN):
self._dbus_init()
objects = self.bluez_manager.GetManagedObjects()
self.py3.log(" --- SUCCESS ---")
except GLib.Error as err:
self.py3.log(" --- FAILED ---")
if err.matches(Gio.dbus_error_quark(), Gio.DBusError.SERVICE_UNKNOWN):
self._dbus_init()
self.py3.log(" --- MATCHED ---")
else:
self.py3.log(" --- RAISED ---")
raise
else:
break
raise

temporary = {}

Expand Down

0 comments on commit 89407ac

Please sign in to comment.