#! /usr/bin/env python2.5 # -*- coding: utf-8 -*- import gobject, dbus import time import os from dbus.mainloop.glib import DBusGMainLoop def handle_call(obj_path, callernumber): global blocklist print 'Calling from '+callernumber+'...' import urllib webFile = urllib.urlopen('http://nummer.tejpweb.se/nummer/?nummer='+callernumber) name = webFile.read() print name + ' is calling.' import pynotify pynotify.init( name ) n = pynotify.Notification(name, "Call from " + name) n.set_urgency(pynotify.URGENCY_CRITICAL) n.show() DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() bus.add_signal_receiver(handle_call, path='/com/nokia/csd/call', dbus_interface='com.nokia.csd.Call', signal_name='Coming') gobject.MainLoop().run()