~ubuntu-branches/ubuntu/utopic/telepathy-python/utopic

« back to all changes in this revision

Viewing changes to examples/call.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonny Lamb
  • Date: 2009-02-16 10:47:31 UTC
  • mfrom: (7.1.14 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090216104731-3l467x71wygwok32
Tags: 0.15.6-2
debian/control: Added myself to Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
        channel[CHANNEL_INTERFACE].connect_to_signal('Closed', self.closed_cb)
93
93
        channel[CHANNEL_INTERFACE_GROUP].connect_to_signal('MembersChanged',
94
94
            self.members_changed_cb)
 
95
        channel[CHANNEL_TYPE_STREAMED_MEDIA].connect_to_signal(
 
96
            'StreamError', self.stream_error_cb)
95
97
 
96
98
        stream_engine = get_stream_engine()
97
99
        handler = dbus.Interface(stream_engine,
106
108
 
107
109
        self.channel = channel
108
110
 
 
111
    def stream_error_cb(self, *foo):
 
112
        print 'error: %r' % (foo,)
 
113
        self.channel.close()
 
114
 
109
115
    def closed_cb(self):
110
116
        print "channel closed"
111
117
        self.quit()
172
178
        pending = channel[CHANNEL_INTERFACE_GROUP].GetLocalPendingMembers()
173
179
        channel[CHANNEL_INTERFACE_GROUP].AddMembers(pending, "")
174
180
 
 
181
    def closed_cb(self):
 
182
        print "channel closed"
 
183
        print "waiting for incoming call"
 
184
 
175
185
if __name__ == '__main__':
176
186
    args = sys.argv[1:]
177
187
 
178
188
    assert len(args) in (1, 2)
179
189
 
180
190
    if len(args) > 1:
181
 
        contact = args[1]
182
191
        call = OutgoingCall(args[0], args[1])
183
192
    else:
184
193
        call = IncomingCall(args[0])