openCom-Companion/sbapp/plyer/platforms/linux/devicename.py

24 lines
390 B
Python
Raw Permalink Normal View History

2022-09-16 18:07:57 +02:00
'''
Module of Linux API for plyer.devicename.
'''
import socket
from plyer.facades import DeviceName
class LinuxDeviceName(DeviceName):
'''
Implementation of Linux DeviceName API.
'''
def _get_device_name(self):
hostname = socket.gethostname()
return hostname
def instance():
'''
Instance for facade proxy.
'''
return LinuxDeviceName()