Remove superfluous PacmanConfiguration.default (#4682)
This commit is contained in:
parent
c0affc895c
commit
274f6c2190
|
|
@ -168,7 +168,7 @@ class ArchConfig:
|
|||
kernels: list[str] = field(default_factory=lambda: [DEFAULT_KERNEL.value])
|
||||
ntp: bool = True
|
||||
packages: list[str] = field(default_factory=list)
|
||||
pacman_config: PacmanConfiguration = field(default_factory=PacmanConfiguration.default)
|
||||
pacman_config: PacmanConfiguration = field(default_factory=PacmanConfiguration)
|
||||
timezone: str = 'UTC'
|
||||
services: list[str] = field(default_factory=list)
|
||||
custom_commands: list[str] = field(default_factory=list)
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class GlobalMenu(AbstractMenu[None]):
|
|||
MenuItem(
|
||||
text=tr('Pacman'),
|
||||
action=self._pacman_configuration,
|
||||
value=PacmanConfiguration.default(),
|
||||
value=PacmanConfiguration(),
|
||||
preview_action=self._prev_pacman_config,
|
||||
key='pacman_config',
|
||||
),
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ class PacmanConfiguration(SubConfig):
|
|||
parallel_downloads: int = 5
|
||||
color: bool = True
|
||||
|
||||
@classmethod
|
||||
def default(cls) -> Self:
|
||||
return cls()
|
||||
|
||||
@override
|
||||
def json(self) -> PacmanConfigSerialization:
|
||||
return {
|
||||
|
|
@ -40,7 +36,7 @@ class PacmanConfiguration(SubConfig):
|
|||
|
||||
@classmethod
|
||||
def parse_arg(cls, args: PacmanConfigSerialization) -> Self:
|
||||
config = cls.default()
|
||||
config = cls()
|
||||
|
||||
if 'parallel_downloads' in args:
|
||||
config.parallel_downloads = int(args['parallel_downloads'])
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class PacmanMenu(AbstractSubMenu[PacmanConfiguration]):
|
|||
config = await super().show()
|
||||
|
||||
if config is None:
|
||||
return PacmanConfiguration.default()
|
||||
return PacmanConfiguration()
|
||||
|
||||
_apply_to_live(config.parallel_downloads)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue