From 765dc3282494cb467af1d3a516aaf01349aa0f2e Mon Sep 17 00:00:00 2001 From: Max Usachev Date: Tue, 22 Jun 2010 15:21:25 +0300 Subject: [PATCH] added caller module --- caller.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 caller.py 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)) -- 1.7.9.5