Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move preview_text method to XorgProfile instead of subclasses implementing it #1918

Merged
merged 3 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions archinstall/default_profiles/desktops/awesome.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional, Any, TYPE_CHECKING
from typing import List, Any, TYPE_CHECKING

from archinstall.default_profiles.profile import ProfileType
from archinstall.default_profiles.xorg import XorgProfile
Expand Down Expand Up @@ -28,10 +28,6 @@ def packages(self) -> List[str]:
'xsel',
]

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()

def install(self, install_session: 'Installer'):
super().install(install_session)

Expand Down
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/budgie.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/cinnamon.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/cutefish.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@ def packages(self) -> List[str]:
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Sddm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()

def install(self, install_session: 'Installer'):
super().install(install_session)
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/deepin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/enlightenment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/gnome.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Gdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/hyperland.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Sddm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/i3.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Sddm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/lxqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Sddm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/mate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/qtile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/sway.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,5 @@ def _ask_seat_access(self):
def do_on_select(self):
self._ask_seat_access()

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()

def install(self, install_session: 'Installer'):
super().install(install_session)
4 changes: 0 additions & 4 deletions archinstall/default_profiles/desktops/xfce4.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ def packages(self) -> List[str]:
@property
def default_greeter_type(self) -> Optional[GreeterType]:
return GreeterType.Lightdm

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()
6 changes: 5 additions & 1 deletion archinstall/default_profiles/xorg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, TYPE_CHECKING, List
from typing import Any, Optional, TYPE_CHECKING, List

from archinstall.default_profiles.profile import Profile, ProfileType

Expand All @@ -20,6 +20,10 @@ def __init__(
support_gfx_driver=True
)

def preview_text(self) -> Optional[str]:
text = str(_('Environment type: {}')).format(self.profile_type.value)
return text + '\n' + self.packages_text()

@property
def packages(self) -> List[str]:
return [
Expand Down