Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/profile/profile_model.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-06-21 17:52:48 +1000
committerGitHub <noreply@github.com>2023-06-21 09:52:48 +0200
commitc7c34c9e704b880ba0ad26696946b6561d2ee784 (patch)
treec9af72ab0f93f85c87b0fddcbd6c25776c2d7ad2 /archinstall/lib/profile/profile_model.py
parent16132e6fc9d54f237f260227f99dad5b639891db (diff)
Make Gfx driver handling saver (#1885)
Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/profile/profile_model.py')
-rw-r--r--archinstall/lib/profile/profile_model.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/archinstall/lib/profile/profile_model.py b/archinstall/lib/profile/profile_model.py
index ad3015ae..2b52073a 100644
--- a/archinstall/lib/profile/profile_model.py
+++ b/archinstall/lib/profile/profile_model.py
@@ -3,6 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Optional, Dict
+from ..hardware import GfxDriver
from archinstall.default_profiles.profile import Profile, GreeterType
if TYPE_CHECKING:
@@ -12,14 +13,14 @@ if TYPE_CHECKING:
@dataclass
class ProfileConfiguration:
profile: Optional[Profile] = None
- gfx_driver: Optional[str] = None
+ gfx_driver: Optional[GfxDriver] = None
greeter: Optional[GreeterType] = None
def json(self) -> Dict[str, Any]:
from .profiles_handler import profile_handler
return {
'profile': profile_handler.to_json(self.profile),
- 'gfx_driver': self.gfx_driver,
+ 'gfx_driver': self.gfx_driver.value if self.gfx_driver else None,
'greeter': self.greeter.value if self.greeter else None
}
@@ -27,9 +28,10 @@ class ProfileConfiguration:
def parse_arg(cls, arg: Dict[str, Any]) -> 'ProfileConfiguration':
from .profiles_handler import profile_handler
greeter = arg.get('greeter', None)
+ gfx_driver = arg.get('gfx_driver', None)
return ProfileConfiguration(
profile_handler.parse_profile_config(arg['profile']),
- arg.get('gfx_driver', None),
+ GfxDriver(gfx_driver) if gfx_driver else None,
GreeterType(greeter) if greeter else None
)