Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/default_profiles/profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/default_profiles/profile.py')
-rw-r--r--archinstall/default_profiles/profile.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/archinstall/default_profiles/profile.py b/archinstall/default_profiles/profile.py
index 49a9c19d..4c85b0c7 100644
--- a/archinstall/default_profiles/profile.py
+++ b/archinstall/default_profiles/profile.py
@@ -178,15 +178,28 @@ class Profile:
def preview_text(self) -> Optional[str]:
"""
- Used for preview text in profiles_bck. If a description is set for a
- profile it will automatically display that one in the preview.
- If no preview or a different text should be displayed just
+ Override this method to provide a preview text for the profile
"""
- if self.description:
- return self.description
- return None
+ return self.packages_text()
- def packages_text(self) -> str:
+ def packages_text(self, include_sub_packages: bool = False) -> Optional[str]:
header = str(_('Installed packages'))
- output = format_cols(self.packages, header)
- return output
+
+ text = ''
+ packages = []
+
+ if self.packages:
+ packages = self.packages
+
+ if include_sub_packages:
+ for p in self.current_selection:
+ if p.packages:
+ packages += p.packages
+
+ text += format_cols(sorted(set(packages)))
+
+ if text:
+ text = f'{header}: \n{text}'
+ return text
+
+ return None