How to use the jeepney.bus_messages.MatchRule function in jeepney

To help you get started, we’ve selected a few jeepney examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mitya57 / secretstorage / secretstorage / util.py View on Github external
def add_match_rules(connection: DBusConnection) -> None:
	"""Adds match rules for the given connection.

	Currently it matches all messages from the Prompt interface, as the
	mock service (unlike GNOME Keyring) does not specify the signal
	destination.

	.. versionadded:: 3.1
	"""
	rule = MatchRule(sender=BUS_NAME, interface=PROMPT_IFACE)
	dbus = DBusAddressWrapper(path='/org/freedesktop/DBus',
	                          interface='org.freedesktop.DBus',
	                          connection=connection)
	dbus.bus_name = 'org.freedesktop.DBus'
	dbus.call('AddMatch', 's', rule.serialise())