mirror of
https://github.com/dw-0/kiauh.git
synced 2026-03-22 18:38:34 +05:00
refactor: use | instead of Union
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -6,10 +6,11 @@
|
||||
# #
|
||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||
# ======================================================================= #
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import field
|
||||
from enum import Enum
|
||||
from typing import List, Union
|
||||
from typing import List
|
||||
|
||||
|
||||
class FlashMethod(Enum):
|
||||
@@ -30,9 +31,9 @@ class ConnectionType(Enum):
|
||||
|
||||
class FlashOptions:
|
||||
_instance = None
|
||||
_flash_method: Union[FlashMethod, None] = None
|
||||
_flash_command: Union[FlashCommand, None] = None
|
||||
_connection_type: Union[ConnectionType, None] = None
|
||||
_flash_method: FlashMethod | None = None
|
||||
_flash_command: FlashCommand | None = None
|
||||
_connection_type: ConnectionType | None = None
|
||||
_mcu_list: List[str] = field(default_factory=list)
|
||||
_selected_mcu: str = ""
|
||||
_selected_board: str = ""
|
||||
@@ -48,27 +49,27 @@ class FlashOptions:
|
||||
cls._instance = None
|
||||
|
||||
@property
|
||||
def flash_method(self) -> Union[FlashMethod, None]:
|
||||
def flash_method(self) -> FlashMethod | None:
|
||||
return self._flash_method
|
||||
|
||||
@flash_method.setter
|
||||
def flash_method(self, value: Union[FlashMethod, None]):
|
||||
def flash_method(self, value: FlashMethod | None):
|
||||
self._flash_method = value
|
||||
|
||||
@property
|
||||
def flash_command(self) -> Union[FlashCommand, None]:
|
||||
def flash_command(self) -> FlashCommand | None:
|
||||
return self._flash_command
|
||||
|
||||
@flash_command.setter
|
||||
def flash_command(self, value: Union[FlashCommand, None]):
|
||||
def flash_command(self, value: FlashCommand | None):
|
||||
self._flash_command = value
|
||||
|
||||
@property
|
||||
def connection_type(self) -> Union[ConnectionType, None]:
|
||||
def connection_type(self) -> ConnectionType | None:
|
||||
return self._connection_type
|
||||
|
||||
@connection_type.setter
|
||||
def connection_type(self, value: Union[ConnectionType, None]):
|
||||
def connection_type(self, value: ConnectionType | None):
|
||||
self._connection_type = value
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user