mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
splitting python complete
This commit is contained in:
@@ -2,9 +2,14 @@ import os
|
||||
import subprocess
|
||||
cimport constants
|
||||
cdef class HardwareService:
|
||||
cdef str _CACHED_HW_INFO = None
|
||||
|
||||
@staticmethod
|
||||
cdef str get_hardware_info():
|
||||
global _CACHED_HW_INFO
|
||||
if _CACHED_HW_INFO is not None:
|
||||
return <str> _CACHED_HW_INFO
|
||||
|
||||
if os.name == 'nt': # windows
|
||||
os_command = (
|
||||
"powershell -Command \""
|
||||
@@ -34,5 +39,6 @@ cdef class HardwareService:
|
||||
cdef str drive_serial = lines[len_lines-1]
|
||||
|
||||
cdef str res = f'CPU: {cpu}. GPU: {gpu}. Memory: {memory}. DriveSerial: {drive_serial}'
|
||||
constants.log(f'Gathered hardware: {res}')
|
||||
constants.log(<str>f'Gathered hardware: {res}')
|
||||
_CACHED_HW_INFO = res
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user