File: devicename.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 (44 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (2)
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
'''DeviceName facade.

Returns the following depending on the platform:

* **Android**: Android Device name
* **Linux**: Hostname of the machine
* **OS X**: Hostname of the machine
* **Windows**: Hostname of the machine

Simple Example
--------------

To get the Device Name::

    >>> from plyer import devicename
    >>> devicename.device_name
    'Oneplus 3'

.. versionadded:: 2.1.0
    - first release


Supported Platforms
-------------------
Android, Windows, OS X, Linux

'''


class DeviceName:
    '''
    DeviceName facade.
    '''

    @property
    def device_name(self):
        '''
        Property that returns the device name of the platform.
        '''
        return self._get_device_name()

    # private
    def _get_device_name(self):
        raise NotImplementedError()