All pastes #1944068 Raw Edit

Unnamed

public python v1 · immutable
#1944068 ·published 2010-09-19 10:12 UTC
rendered paste body
#!/usr/bin/env python## This observer tracks telepathy events and reports events to the Zeitgeist# engine. ## Authors: Morten Mjelva <morten.mjelva@gmail.com>import gobjectfrom gi.repository import TelepathyGLib as Tpdef observe_channels(observer, account, connection, channels, dispatch_op, requests, context, user_data):    print "channels observed"    for channel in channels:        props = channel.borrow_immutable_properties()        print props    context.accept()dbus = Tp.DBusDaemon.dup()observer = Tp.SimpleObserver.new(dbus, True, 'Zeitgeist', True, observe_channels, None)#FIXME# constants not working? :'(# We want to observe text chats and media streams (A/V via webcam or phone)observer.add_observer_filter({    'org.freedesktop.Telepathy.Channel.ChannelType': 'org.freedesktop.Telepathy.Channel.Type.Text'    })observer.add_observer_filter({    'org.freedesktop.Telepathy.Channel.ChannelType': 'org.freedesktop.Telepathy.Channel.Type.StreamedMedia'    })observer.register()main_loop = gobject.MainLoop()main_loop.run()