mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 19:56:31 +00:00
fix id problems with day/winter switch
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
import subprocess
|
||||
from security cimport Security
|
||||
import psutil
|
||||
|
||||
cdef class HardwareInfo:
|
||||
def __init__(self, str cpu, str gpu, str memory, str mac_address, str hw_hash):
|
||||
def __init__(self, str cpu, str gpu, str memory, str mac_address):
|
||||
self.cpu = cpu
|
||||
self.gpu = gpu
|
||||
self.memory = memory
|
||||
self.mac_address = mac_address
|
||||
self.hash = hw_hash
|
||||
|
||||
cdef to_json_object(self):
|
||||
return {
|
||||
"CPU": self.cpu,
|
||||
"GPU": self.gpu,
|
||||
"MacAddress": self.mac_address,
|
||||
"Memory": self.memory,
|
||||
"Hash": self.hash,
|
||||
"Memory": self.memory
|
||||
}
|
||||
|
||||
def __str__(self):
|
||||
@@ -68,7 +65,5 @@ cdef class HardwareService:
|
||||
cdef str gpu = lines[1].replace("Name=", "").replace(" ", " ")
|
||||
cdef str memory = lines[2].replace("TotalVisibleMemorySize=", "").replace(" ", " ")
|
||||
cdef str mac_address = self.get_mac_address()
|
||||
cdef str full_hw_str = f'Azaion_{mac_address}_{cpu}_{gpu}'
|
||||
|
||||
hw_hash = Security.calc_hash(full_hw_str)
|
||||
return HardwareInfo(cpu, gpu, memory, mac_address, hw_hash)
|
||||
return HardwareInfo(cpu, gpu, memory, mac_address)
|
||||
|
||||
Reference in New Issue
Block a user