mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 12:02:15 +03:00
Method for getting device language and getting computer model for showing Ahenk informations on Lider Console are added to core.
This commit is contained in:
parent
034df8d783
commit
093e432862
3 changed files with 15 additions and 1 deletions
|
@ -136,7 +136,8 @@ class Registration:
|
||||||
'hardware.usbDevices': str(System.Hardware.usb_devices()),
|
'hardware.usbDevices': str(System.Hardware.usb_devices()),
|
||||||
'hardware.printers': str(System.Hardware.printers()),
|
'hardware.printers': str(System.Hardware.printers()),
|
||||||
'hardware.systemDefinitions': str(System.Hardware.system_definitions()),
|
'hardware.systemDefinitions': str(System.Hardware.system_definitions()),
|
||||||
'hardware.memory.total': System.Hardware.Memory.total(),
|
'hardware.model.version': str(System.Hardware.machine_model()),
|
||||||
|
'hardware.memory.total': System.Hardware.Memory.total(),
|
||||||
'hardware.network.ipAddresses': str(System.Hardware.Network.ip_addresses()),
|
'hardware.network.ipAddresses': str(System.Hardware.Network.ip_addresses()),
|
||||||
'sessions.userNames': str(System.Sessions.user_name()),
|
'sessions.userNames': str(System.Sessions.user_name()),
|
||||||
'bios.releaseDate': System.BIOS.release_date()[1].replace('\n', '') if System.BIOS.release_date()[
|
'bios.releaseDate': System.BIOS.release_date()[1].replace('\n', '') if System.BIOS.release_date()[
|
||||||
|
|
|
@ -573,6 +573,14 @@ class System:
|
||||||
if len(list(set(line.split(' ')).intersection(['Manufacturer:', 'Product']))) > 0:
|
if len(list(set(line.split(' ')).intersection(['Manufacturer:', 'Product']))) > 0:
|
||||||
arr.append(line)
|
arr.append(line)
|
||||||
return arr
|
return arr
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def machine_model():
|
||||||
|
try:
|
||||||
|
result_code, p_out, p_err = Util.execute('sudo dmidecode --string system-version')
|
||||||
|
return str(p_out)
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def machine_type():
|
def machine_type():
|
||||||
|
|
|
@ -291,6 +291,11 @@ class Util:
|
||||||
def generate_uuid():
|
def generate_uuid():
|
||||||
return str(uuid.uuid4())
|
return str(uuid.uuid4())
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_language():
|
||||||
|
locale_info = locale.getdefaultlocale()
|
||||||
|
return locale_info[0]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set_permission(path, permission_code):
|
def set_permission(path, permission_code):
|
||||||
Util.execute('chmod -R {0} {1}'.format(permission_code, path))
|
Util.execute('chmod -R {0} {1}'.format(permission_code, path))
|
||||||
|
|
Loading…
Reference in a new issue