[patch] [python] examples: Don't load a main loop when only making blocking calls

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jan 16 11:54:31 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From 916df7703d828afec95635d309ca83bc1c05fd98 Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Tue, 16 Jan 2007 19:51:28 +0000
Subject: [PATCH] examples: Don't load a main loop when only making blocking calls

- ---
 examples/example-client.py       |    2 --
 examples/list-system-services.py |    3 +--
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/examples/example-client.py b/examples/example-client.py
index 7effb04..5d881fd 100644
- --- a/examples/example-client.py
+++ b/examples/example-client.py
@@ -10,7 +10,6 @@ import sys
 from traceback import print_exc
 
 import dbus
- -import dbus.mainloop.glib
 
 def main():
     bus = dbus.SessionBus()
@@ -53,5 +52,4 @@ def main():
         iface.Exit()
 
 if __name__ == '__main__':
- -    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
     main()
diff --git a/examples/list-system-services.py b/examples/list-system-services.py
index 28dae35..0474574 100644
- --- a/examples/list-system-services.py
+++ b/examples/list-system-services.py
@@ -6,7 +6,6 @@ List services on the system bus (default) or the session bus."""
 import sys
 
 import dbus
- -from dbus.mainloop import NULL_MAIN_LOOP
 
 def main(argv):
     factory = dbus.SystemBus
@@ -21,7 +20,7 @@ def main(argv):
 
     # Get a connection to the system or session bus as appropriate
     # We're only using blocking calls, so don't actually need a main loop here
- -    bus = factory(mainloop=NULL_MAIN_LOOP)
+    bus = factory()
 
     # Get a reference to the desktop bus' standard object, denoted
     # by the path /org/freedesktop/DBus. 
- -- 
1.4.4.4

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFFrS13WSc8zVUw7HYRAkvkAJ9EdSwpBNfHin2CbkkEWLLfsDvdHQCfRbws
rU43fs3o/s5zYDuUkaR7pxU=
=2lht
-----END PGP SIGNATURE-----


More information about the dbus mailing list