File: example.py

package info (click to toggle)
feedbackd 0.8.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,060 kB
  • sloc: ansic: 7,924; xml: 97; makefile: 31; sh: 30; python: 8
file content (20 lines) | stat: -rwxr-xr-x 612 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python3
#
# depends on GObject introspection data for libfeedback
#
# After building from source you can start this example like this:
#   _build/run examples/example.py
# Otherwise like this:
#   GI_TYPELIB_PATH=</somepath/girepository-x.y/> example.py

import gi
import time
gi.require_version('Lfb', '0.0')
from gi.repository import Lfb

Lfb.init('org.sigxcpu.lfbexample')
event = Lfb.Event.new('phone-incoming-call')
event.trigger_feedback()
# feedbackd terminates feedback from clients that disconnect from DBus to avoid
# feedback not being stopped. So wait a bit before quitting:
time.sleep(3)