Don't need to own a well-known bus name any more.
Allow open-fprintd call our methods.
This commit is contained in:
parent
4ea1e6227b
commit
29c529f5c6
3 changed files with 14 additions and 2 deletions
|
|
@ -161,9 +161,8 @@ if __name__ == '__main__':
|
||||||
tls.trace_enabled = True
|
tls.trace_enabled = True
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
bus_name = dbus.service.BusName('io.github.uunicorn.Fprint', bus)
|
|
||||||
|
|
||||||
svc = Device(bus_name)
|
svc = Device(bus)
|
||||||
|
|
||||||
watcher = None
|
watcher = None
|
||||||
def watch_cb(name):
|
def watch_cb(name):
|
||||||
|
|
@ -176,5 +175,8 @@ if __name__ == '__main__':
|
||||||
mgr.RegisterDevice(svc)
|
mgr.RegisterDevice(svc)
|
||||||
watcher = bus.watch_name_owner('net.reactivated.Fprint', watch_cb)
|
watcher = bus.watch_name_owner('net.reactivated.Fprint', watch_cb)
|
||||||
|
|
||||||
|
# Kick off the open-fprintd if it was not started yet
|
||||||
|
bus.get_object('net.reactivated.Fprint', '/net/reactivated/Fprint/Manager')
|
||||||
|
|
||||||
loop.run()
|
loop.run()
|
||||||
|
|
||||||
|
|
|
||||||
9
dbus_service/io.github.uunicorn.Fprint.conf
Normal file
9
dbus_service/io.github.uunicorn.Fprint.conf
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
<policy user="root">
|
||||||
|
<!-- Allow open-fprintd service call our methods -->
|
||||||
|
<allow send_interface="io.github.uunicorn.Fprint.Device"/>
|
||||||
|
</policy>
|
||||||
|
</busconfig>
|
||||||
1
setup.py
1
setup.py
|
|
@ -16,6 +16,7 @@ setup(name='python-validity',
|
||||||
],
|
],
|
||||||
data_files=[
|
data_files=[
|
||||||
('share/python-validity/playground/', ['factory-reset.py', 'pair.py', 'prototype.py']),
|
('share/python-validity/playground/', ['factory-reset.py', 'pair.py', 'prototype.py']),
|
||||||
|
('share/dbus-1/system.d/', ['dbus_service/io.github.uunicorn.Fprint.conf']),
|
||||||
('lib/python-validity/', ['dbus_service/dbus-service']),
|
('lib/python-validity/', ['dbus_service/dbus-service']),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue