telepathy-farstream: python example:`Add signal to call handler

Olivier CrĂȘte tester at kemper.freedesktop.org
Wed Nov 16 22:16:15 UTC 2016


Module: telepathy-farstream
Branch: master
Commit: 20e71ec67ebb35fd180f083806fd6fe9ca94ea99
URL:    http://cgit.freedesktop.org/telepathy/telepathy-farstream/commit/?id=20e71ec67ebb35fd180f083806fd6fe9ca94ea99

Author: Olivier CrĂȘte <olivier.crete at collabora.com>
Date:   Tue Nov 15 17:39:01 2016 -0500

python example:`Add signal to call handler

---

 examples/python/callhandler.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/python/callhandler.py b/examples/python/callhandler.py
index 2d20e33..f4053b2 100644
--- a/examples/python/callhandler.py
+++ b/examples/python/callhandler.py
@@ -23,8 +23,13 @@ from constants import *
 
 from callchannel import CallChannel
 
-class CallHandler:
+class CallHandler(GObject.Object):
+    __gsignals__ = {
+        'new-channel' : (GObject.SIGNAL_RUN_LAST, None, (object,))
+        }
+
     def __init__(self, bus_name = 'CallDemo'):
+        GObject.Object.__init__(self)
         TelepathyGLib.debug_set_flags("all")
         am = TelepathyGLib.AccountManager.dup()
         self.handler = handler = TelepathyGLib.SimpleHandler.new_with_am(
@@ -43,6 +48,7 @@ class CallHandler:
                             requests_satisfied, user_action_time, context):
         assert len(channels) == 1
         cchannel = CallChannel(conn, channels[0])
+        self.emit("new-channel", channels[0])
         context.accept()
         channels[0].accept_async(None)
 



More information about the telepathy-commits mailing list