mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:19:05 +08:00
Put BaseModel in quotes
Contributes to CURA-7180
This commit is contained in:
parent
33a812d696
commit
4b1087a138
@ -27,7 +27,7 @@ class KeyringAttribute:
|
|||||||
"""
|
"""
|
||||||
Descriptor for attributes that need to be stored in the keyring. With Fallback behaviour to the preference cfg file
|
Descriptor for attributes that need to be stored in the keyring. With Fallback behaviour to the preference cfg file
|
||||||
"""
|
"""
|
||||||
def __get__(self, instance: BaseModel, owner: type) -> Optional[str]:
|
def __get__(self, instance: "BaseModel", owner: type) -> Optional[str]:
|
||||||
if self._store_secure: # type: ignore
|
if self._store_secure: # type: ignore
|
||||||
try:
|
try:
|
||||||
value = keyring.get_password("cura", self._keyring_name)
|
value = keyring.get_password("cura", self._keyring_name)
|
||||||
@ -39,7 +39,7 @@ class KeyringAttribute:
|
|||||||
else:
|
else:
|
||||||
return getattr(instance, self._name)
|
return getattr(instance, self._name)
|
||||||
|
|
||||||
def __set__(self, instance: BaseModel, value: Optional[str]):
|
def __set__(self, instance: "BaseModel", value: Optional[str]):
|
||||||
if self._store_secure:
|
if self._store_secure:
|
||||||
setattr(instance, self._name, None)
|
setattr(instance, self._name, None)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user