Use Self in default_profiles (#4125)

This commit is contained in:
codefiles 2026-01-14 00:03:32 -05:00 committed by GitHub
parent 2e9d5e4829
commit 20460e1c29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -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.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult
from archinstall.lib.output import info from archinstall.lib.output import info
@ -13,7 +13,7 @@ if TYPE_CHECKING:
class DesktopProfile(Profile): class DesktopProfile(Profile):
def __init__(self, current_selection: list[Profile] = []) -> None: def __init__(self, current_selection: list[Self] = []) -> None:
super().__init__( super().__init__(
'Desktop', 'Desktop',
ProfileType.Desktop, ProfileType.Desktop,
@ -68,7 +68,7 @@ class DesktopProfile(Profile):
group = MenuItemGroup(items, sort_items=True, sort_case_sensitive=False) group = MenuItemGroup(items, sort_items=True, sort_case_sensitive=False)
group.set_selected_by_value(self.current_selection) group.set_selected_by_value(self.current_selection)
result = SelectMenu[Profile]( result = SelectMenu[Self](
group, group,
multi=True, multi=True,
allow_reset=True, allow_reset=True,

View File

@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from enum import Enum, auto from enum import Enum, auto
from typing import TYPE_CHECKING from typing import TYPE_CHECKING, Self
from archinstall.lib.translationhandler import tr from archinstall.lib.translationhandler import tr
@ -46,7 +46,7 @@ class Profile:
self, self,
name: str, name: str,
profile_type: ProfileType, profile_type: ProfileType,
current_selection: list[Profile] = [], current_selection: list[Self] = [],
packages: list[str] = [], packages: list[str] = [],
services: list[str] = [], services: list[str] = [],
support_gfx_driver: bool = False, support_gfx_driver: bool = False,

View File

@ -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.default_profiles.profile import Profile, ProfileType, SelectResult
from archinstall.lib.output import info from archinstall.lib.output import info
@ -13,7 +13,7 @@ if TYPE_CHECKING:
class ServerProfile(Profile): class ServerProfile(Profile):
def __init__(self, current_value: list[Profile] = []): def __init__(self, current_value: list[Self] = []):
super().__init__( super().__init__(
'Server', 'Server',
ProfileType.Server, ProfileType.Server,
@ -34,7 +34,7 @@ class ServerProfile(Profile):
group = MenuItemGroup(items, sort_items=True) group = MenuItemGroup(items, sort_items=True)
group.set_selected_by_value(self.current_selection) group.set_selected_by_value(self.current_selection)
result = SelectMenu[Profile]( result = SelectMenu[Self](
group, group,
allow_reset=True, allow_reset=True,
allow_skip=True, allow_skip=True,