splitting python complete

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-08-12 14:48:56 +03:00
parent fc6e5db795
commit ad782bcbaa
31 changed files with 834 additions and 369 deletions
+7 -1
View File
@@ -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