summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-01-20 12:39:07 +0000
committerSimon McVittie <smcv@debian.org>2016-01-20 12:39:07 +0000
commitd7677ab1bcabe60e84215eb17b51b644737bfcb0 (patch)
tree6f5d1c2fde097fa98c26c8e007390ec163691721 /examples
parentea0e8705750e8b4448e5e51c86d07132cf1ac1c8 (diff)
Use gi instead of gobject, everywhere except dbus.gobject_service
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/example-async-client.py6
-rwxr-xr-xexamples/example-service.py4
-rwxr-xr-xexamples/example-signal-emitter.py4
-rwxr-xr-xexamples/example-signal-recipient.py8
-rwxr-xr-xexamples/gconf-proxy-service2.py4
-rwxr-xr-xexamples/unix-fd-service.py4
6 files changed, 15 insertions, 15 deletions
diff --git a/examples/example-async-client.py b/examples/example-async-client.py
index c9e0a4f..a24191d 100755
--- a/examples/example-async-client.py
+++ b/examples/example-async-client.py
@@ -32,7 +32,7 @@ python example-client.py --exit-service
import sys
import traceback
-import gobject
+from gi.repository import GLib
import dbus
import dbus.mainloop.glib
@@ -108,13 +108,13 @@ if __name__ == '__main__':
sys.exit(1)
# Make the method call after a short delay
- gobject.timeout_add(1000, make_calls)
+ GLib.timeout_add(1000, make_calls)
failed = False
hello_replied = False
raise_replied = False
- loop = gobject.MainLoop()
+ loop = GLib.MainLoop()
loop.run()
if failed:
raise SystemExit("Example async client failed!")
diff --git a/examples/example-service.py b/examples/example-service.py
index c42b526..af22577 100755
--- a/examples/example-service.py
+++ b/examples/example-service.py
@@ -30,7 +30,7 @@ python example-client.py --exit-service
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-import gobject
+from gi.repository import GLib
import dbus
import dbus.service
@@ -77,7 +77,7 @@ if __name__ == '__main__':
name = dbus.service.BusName("com.example.SampleService", session_bus)
object = SomeObject(session_bus, '/SomeObject')
- mainloop = gobject.MainLoop()
+ mainloop = GLib.MainLoop()
print "Running example service."
print usage
mainloop.run()
diff --git a/examples/example-signal-emitter.py b/examples/example-signal-emitter.py
index bb832aa..6cf1387 100755
--- a/examples/example-signal-emitter.py
+++ b/examples/example-signal-emitter.py
@@ -29,7 +29,7 @@ python example-signal-recipient.py --exit-service
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-import gobject
+from gi.repository import GLib
import dbus
import dbus.service
@@ -63,7 +63,7 @@ if __name__ == '__main__':
name = dbus.service.BusName('com.example.TestService', session_bus)
object = TestObject(session_bus)
- loop = gobject.MainLoop()
+ loop = GLib.MainLoop()
print "Running example signal emitter service."
print usage
loop.run()
diff --git a/examples/example-signal-recipient.py b/examples/example-signal-recipient.py
index 4810f5e..818b0fa 100755
--- a/examples/example-signal-recipient.py
+++ b/examples/example-signal-recipient.py
@@ -32,7 +32,7 @@ python example-signal-recipient.py --exit-service
import sys
import traceback
-import gobject
+from gi.repository import GLib
import dbus
import dbus.mainloop.glib
@@ -48,7 +48,7 @@ def emit_signal():
object.emitHelloSignal(dbus_interface="com.example.TestService")
#reply_handler = handle_reply, error_handler = handle_error)
# exit after waiting a short time for the signal
- gobject.timeout_add(2000, loop.quit)
+ GLib.timeout_add(2000, loop.quit)
if sys.argv[1:] == ['--exit-service']:
object.Exit(dbus_interface='com.example.TestService')
@@ -93,7 +93,7 @@ if __name__ == '__main__':
bus.add_signal_receiver(catchall_testservice_interface_handler, dbus_interface = "com.example.TestService", message_keyword='dbus_message')
# Tell the remote object to emit the signal after a short delay
- gobject.timeout_add(2000, emit_signal)
+ GLib.timeout_add(2000, emit_signal)
- loop = gobject.MainLoop()
+ loop = GLib.MainLoop()
loop.run()
diff --git a/examples/gconf-proxy-service2.py b/examples/gconf-proxy-service2.py
index 86567cb..b9c78ef 100755
--- a/examples/gconf-proxy-service2.py
+++ b/examples/gconf-proxy-service2.py
@@ -34,7 +34,7 @@ import dbus
import dbus.mainloop.glib
import dbus.service
-import gobject
+from gi.repository import GLib
import gconf
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -68,5 +68,5 @@ gconf_service = GConfObject()
print ("GConf Proxy service started.")
print ("Run 'gconf-proxy-client.py' to fetch a GConf key through the proxy...")
-mainloop = gobject.MainLoop()
+mainloop = GLib.MainLoop()
mainloop.run()
diff --git a/examples/unix-fd-service.py b/examples/unix-fd-service.py
index 7850049..8188647 100755
--- a/examples/unix-fd-service.py
+++ b/examples/unix-fd-service.py
@@ -29,7 +29,7 @@ python unix-fd-client.py
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-import gobject
+from gi.repository import GLib
import dbus
import dbus.service
@@ -69,7 +69,7 @@ if __name__ == '__main__':
name = dbus.service.BusName("com.example.SampleService", session_bus)
object = SomeObject(session_bus, '/SomeObject')
- mainloop = gobject.MainLoop()
+ mainloop = GLib.MainLoop()
print "Running fd service."
print usage
mainloop.run()