From: Max Usachev Date: Tue, 22 Jun 2010 12:21:25 +0000 (+0300) Subject: added caller module X-Git-Url: http://git.maemo.org/git/?p=meabook;a=commitdiff_plain;h=765dc3282494cb467af1d3a516aaf01349aa0f2e added caller module --- diff --git a/caller.py b/caller.py new file mode 100644 index 0000000..6ec15f7 --- /dev/null +++ b/caller.py @@ -0,0 +1,18 @@ +import dbus + +class PhoneCaller: + def __init__(self): + self.caller = None + + def call(self, number): + """Make Phone call.""" + + # lazy creation + if self.caller is None: + import dbus + try: + self.caller = dbus.Interface(dbus.SystemBus().get_object( \ + 'com.nokia.csd', '/com/nokia/csd/call'), 'com.nokia.csd.Call') + except dbus.exceptions.DBusException: + return + self.caller.CreateWith(number, dbus.UInt32(0))