mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-13 18:28:50 +01:00
try exception on bluez dbus init
This commit is contained in:
parent
efd9459ab3
commit
5e29592572
@ -46,16 +46,19 @@ def setup_dbus(force=True):
|
|||||||
|
|
||||||
|
|
||||||
### BlueZ
|
### BlueZ
|
||||||
proxy_obj = bus.get_object("org.bluez", "/")
|
try:
|
||||||
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
|
proxy_obj = bus.get_object("org.bluez", "/")
|
||||||
objects = manager.GetManagedObjects()
|
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
|
||||||
|
objects = manager.GetManagedObjects()
|
||||||
|
|
||||||
|
for path, interfaces in objects.iteritems():
|
||||||
|
if "org.bluez.Device1" in interfaces:
|
||||||
|
devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy
|
||||||
|
|
||||||
for path, interfaces in objects.iteritems():
|
proxy_obj = bus.get_object("org.bluez", "/org/bluez/hci0")
|
||||||
if "org.bluez.Device1" in interfaces:
|
adapter = dbus.Interface(proxy_obj, "org.bluez.Adapter1")
|
||||||
devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
proxy_obj = bus.get_object("org.bluez", "/org/bluez/hci0")
|
|
||||||
adapter = dbus.Interface(proxy_obj, "org.bluez.Adapter1")
|
|
||||||
|
|
||||||
if not daemon:
|
if not daemon:
|
||||||
print("Error connecting to wicd via D-Bus")
|
print("Error connecting to wicd via D-Bus")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user