dbus/python/examples example-signal-recipient.py,1.7,1.8
John Palmieri
johnp at freedesktop.org
Wed Aug 17 21:04:59 PDT 2005
Update of /cvs/dbus/dbus/python/examples
In directory gabe:/tmp/cvs-serv4207/python/examples
Modified Files:
example-signal-recipient.py
Log Message:
* ChangeLog: clean up my last entry a bit
* doc/introspect.xsl: New stylesheet for converting introspection data
into browser renderable xhtml. Contributed by Lennart Poettering.
* doc/introspect.dtd: Fixups in the introspect format from Lennart
Poettering.
* doc/dbus-tutorial.xml:
- Add Colin Walter to the Authors section for authoring the GLib
section
- Add descriptions of the new signature and type functionality
in the Python complex type mapping section
- Add a sidenote on the new args matching functionality in
the Python bindings
- Fixed up some of the examples to use the gobject.MainLoop
instead of gtk.main
* python/_dbus.py:
(Bus::_create_args_dict): New. Converts a hash of arg matches
to a more useable format
(Bus::add_signal_receiver): add a **keywords parameter for catching
arg match parameters
(Bus::remove_signal_receiver): add a **keywords parameter for catching
arg match parameters
* python/matchrules.py:
(MatchTree::exec_matches): Check for arg matches
(SignalMatchRule::add_args_match): New method
(SignalMatchRule::execute): Added args_list parameter as an optimization
so we don't have to marshal the args more than once
(SignalMatchRule::match_args_from_list): New method that checks to see
if the rule's arg matches match an argument list. Only arguments
set in the rule are checked.
(SignalMatchRule::match_args_from_rule): New method that checks to see
if the rule's arg matches match another rule's. All args have to match
in order for this method to return true. If either rule has more args
then it is not a match.
(SignalMatchRule::is_match): Add args match
(SignalMatchRule::repr): Add args to the final output if they exist
Index: example-signal-recipient.py
===================================================================
RCS file: /cvs/dbus/dbus/python/examples/example-signal-recipient.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- example-signal-recipient.py 17 Jul 2005 21:02:56 -0000 1.7
+++ example-signal-recipient.py 18 Aug 2005 04:04:57 -0000 1.8
@@ -38,13 +38,14 @@
def catchall_testservice_interface_handler(hello_string, dbus_message):
print "org.designfu.TestService interface says " + hello_string + " when it sent signal " + dbus_message.get_member()
-object.connect_to_signal("HelloSignal", hello_signal_handler, dbus_interface="org.designfu.TestService")
+object.connect_to_signal("HelloSignal", hello_signal_handler, dbus_interface="org.designfu.TestService", arg0="Hello")
#lets make a catchall
bus.add_signal_receiver(catchall_signal_handler)
bus.add_signal_receiver(catchall_hello_signals_handler, dbus_interface = "org.designfu.TestService", signal_name = "HelloSignal")
bus.add_signal_receiver(catchall_testservice_interface_handler, dbus_interface = "org.designfu.TestService")
+
gobject.timeout_add(2000, emit_signal)
# Tell the remote object to emit the signal
More information about the dbus-commit
mailing list