File: call.py

package info (click to toggle)
python-plyer 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,808 kB
  • sloc: python: 13,395; sh: 217; makefile: 177
file content (59 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
'''
Call
====

The :class:`Call` provides access to calling feature of your device.

.. note::
    - On Android your app needs the `CALL_PHONE` or `CALL_PRIVILEGED`
    permission in order to make calls.

    - Dialing call feature in not supported yet in iOS devices.

Simple Examples
---------------

To make call::

    >>> from plyer import call
    >>> tel = 9999222299
    >>> call.makecall(tel=tel)

To dial call::

    >>> call.dialcall()

Supported Platforms
-------------------
Android, iOS

'''


class Call:
    '''
    Call facade.
    '''

    def makecall(self, tel):
        '''
        Make calls using your device.

        :param tel: The reciever
        :type tel: number
        '''
        self._makecall(tel=tel)

    def dialcall(self):
        '''
        Opens dialing interface.
        '''
        self._dialcall()

    # private

    def _makecall(self, **kwargs):
        raise NotImplementedError()

    def _dialcall(self, **kwargs):
        raise NotImplementedError()