mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-08-19 21:13:21 -07:00
refactoring
This commit is contained in:
parent
8489949f2c
commit
30ba51edf7
24 changed files with 663 additions and 459 deletions
|
@ -15,6 +15,12 @@ class UPerson(IState):
|
|||
def __str__(self): return f"UPerson UUID:[...{self._uuid[-4:].hex()}] name:[{self._name}] age:[{self._age}]"
|
||||
def __repr__(self): return self.__str__()
|
||||
|
||||
@staticmethod
|
||||
def from_state(state : dict) -> 'UPerson':
|
||||
ufm = UPerson()
|
||||
ufm.restore_state(state)
|
||||
return ufm
|
||||
|
||||
def restore_state(self, state : dict):
|
||||
self._uuid = state.get('_uuid', None)
|
||||
self._name = state.get('_name', None)
|
||||
|
@ -28,7 +34,7 @@ class UPerson(IState):
|
|||
|
||||
def get_uuid(self) -> Union[bytes, None]:
|
||||
if self._uuid is None:
|
||||
self._uuid = uuid.uuid4().bytes_le
|
||||
self._uuid = uuid.uuid4().bytes
|
||||
return self._uuid
|
||||
|
||||
def set_uuid(self, uuid : Union[bytes, None]):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue