added english localization
[meabook] / caller.py
1 """
2 Phone caller
3 """
4
5 import dbus
6
7 class PhoneCaller:
8     """Caller class."""
9
10     def __init__(self):
11         self.caller = None
12
13     def call(self, number):
14         """Make Phone call."""
15
16         # lazy creation
17         if self.caller is None:
18             try:
19                 self.caller = dbus.Interface(dbus.SystemBus().get_object( \
20                 'com.nokia.csd', '/com/nokia/csd/call'), 'com.nokia.csd.Call')
21             except dbus.exceptions.DBusException:
22                 return
23         try:
24             self.caller.CreateWith(number, dbus.UInt32(0))
25         except dbus.exceptions.DBusException:
26             return
27