some logging in udev
This commit is contained in:
parent
9fc11df229
commit
150c43f41f
|
@ -136,6 +136,7 @@ def monitor_glib(callback, *device_filters):
|
||||||
event = monitor.receive_device()
|
event = monitor.receive_device()
|
||||||
if event:
|
if event:
|
||||||
action, device = event
|
action, device = event
|
||||||
|
# print ("***", action, device)
|
||||||
if action == 'add':
|
if action == 'add':
|
||||||
for filter in filters:
|
for filter in filters:
|
||||||
d_info = _match(action, device, *filter)
|
d_info = _match(action, device, *filter)
|
||||||
|
@ -150,12 +151,15 @@ def monitor_glib(callback, *device_filters):
|
||||||
try:
|
try:
|
||||||
# io_add_watch_full may not be available...
|
# io_add_watch_full may not be available...
|
||||||
GLib.io_add_watch_full(m, GLib.PRIORITY_LOW, GLib.IO_IN, _process_udev_event, callback, device_filters)
|
GLib.io_add_watch_full(m, GLib.PRIORITY_LOW, GLib.IO_IN, _process_udev_event, callback, device_filters)
|
||||||
|
# print ("did io_add_watch_full")
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
# and the priority parameter appeared later in the API
|
# and the priority parameter appeared later in the API
|
||||||
GLib.io_add_watch(m, GLib.PRIORITY_LOW, GLib.IO_IN, _process_udev_event, callback, device_filters)
|
GLib.io_add_watch(m, GLib.PRIORITY_LOW, GLib.IO_IN, _process_udev_event, callback, device_filters)
|
||||||
|
# print ("did io_add_watch with priority")
|
||||||
except:
|
except:
|
||||||
GLib.io_add_watch(m, GLib.IO_IN, _process_udev_event, callback, device_filters)
|
GLib.io_add_watch(m, GLib.IO_IN, _process_udev_event, callback, device_filters)
|
||||||
|
# print ("did io_add_watch")
|
||||||
|
|
||||||
m.start()
|
m.start()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue