Use Self in default_profiles (#4125)
This commit is contained in:
parent
2e9d5e4829
commit
20460e1c29
|
|
@ -1,4 +1,4 @@
|
|||
from typing import TYPE_CHECKING, override
|
||||
from typing import TYPE_CHECKING, Self, override
|
||||
|
||||
from archinstall.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult
|
||||
from archinstall.lib.output import info
|
||||
|
|
@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|||
|
||||
|
||||
class DesktopProfile(Profile):
|
||||
def __init__(self, current_selection: list[Profile] = []) -> None:
|
||||
def __init__(self, current_selection: list[Self] = []) -> None:
|
||||
super().__init__(
|
||||
'Desktop',
|
||||
ProfileType.Desktop,
|
||||
|
|
@ -68,7 +68,7 @@ class DesktopProfile(Profile):
|
|||
group = MenuItemGroup(items, sort_items=True, sort_case_sensitive=False)
|
||||
group.set_selected_by_value(self.current_selection)
|
||||
|
||||
result = SelectMenu[Profile](
|
||||
result = SelectMenu[Self](
|
||||
group,
|
||||
multi=True,
|
||||
allow_reset=True,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from enum import Enum, auto
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Self
|
||||
|
||||
from archinstall.lib.translationhandler import tr
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ class Profile:
|
|||
self,
|
||||
name: str,
|
||||
profile_type: ProfileType,
|
||||
current_selection: list[Profile] = [],
|
||||
current_selection: list[Self] = [],
|
||||
packages: list[str] = [],
|
||||
services: list[str] = [],
|
||||
support_gfx_driver: bool = False,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from typing import TYPE_CHECKING, override
|
||||
from typing import TYPE_CHECKING, Self, override
|
||||
|
||||
from archinstall.default_profiles.profile import Profile, ProfileType, SelectResult
|
||||
from archinstall.lib.output import info
|
||||
|
|
@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|||
|
||||
|
||||
class ServerProfile(Profile):
|
||||
def __init__(self, current_value: list[Profile] = []):
|
||||
def __init__(self, current_value: list[Self] = []):
|
||||
super().__init__(
|
||||
'Server',
|
||||
ProfileType.Server,
|
||||
|
|
@ -34,7 +34,7 @@ class ServerProfile(Profile):
|
|||
group = MenuItemGroup(items, sort_items=True)
|
||||
group.set_selected_by_value(self.current_selection)
|
||||
|
||||
result = SelectMenu[Profile](
|
||||
result = SelectMenu[Self](
|
||||
group,
|
||||
allow_reset=True,
|
||||
allow_skip=True,
|
||||
|
|
|
|||
Loading…
Reference in New Issue