diff --git a/libs/lib/xaal/lib/bindings.py b/libs/lib/xaal/lib/bindings.py index aa4a5c3803d923635d7c02cbb6ac8d16866e20c7..6af87aa545614fdc6ec0111cb6d8ada60490d3df 100644 --- a/libs/lib/xaal/lib/bindings.py +++ b/libs/lib/xaal/lib/bindings.py @@ -2,12 +2,13 @@ import uuid from .exceptions import UUIDError + class UUID: def __init__(self, *args, **kwargs): self.__uuid = uuid.UUID(*args, **kwargs) @staticmethod - def random_base(digit=2) -> 'UUID': + def random_base(digit=2) -> "UUID": """zeros the last digits of a random uuid, usefull w/ you want to forge some addresses two digit is great. """ @@ -19,15 +20,15 @@ class UUID: raise UUIDError @staticmethod - def random() -> 'UUID': + def random() -> "UUID": tmp = uuid.uuid1().int return UUID(int=tmp) - def __add__(self, value:int) -> 'UUID': + def __add__(self, value: int) -> "UUID": tmp = self.__uuid.int + value return UUID(int=tmp) - def __sub__(self, value:int) -> 'UUID': + def __sub__(self, value: int) -> "UUID": tmp = self.__uuid.int - value return UUID(int=tmp) @@ -52,7 +53,7 @@ class UUID: def get(self) -> uuid.UUID: return self.__uuid - def set(self, value:uuid.UUID): + def set(self, value: uuid.UUID): self.__uuid = value @property