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:
authorDaniel Girtler <girtler.daniel@gmail.com>2024-03-08 00:43:51 +1100
committerGitHub <noreply@github.com>2024-03-07 14:43:51 +0100
commit08a6d402c4792cae95aec196460dc67aadd86f3c (patch)
treea646e7f2366387750208bbd25d4e06b0f191d9d3 /archinstall/default_profiles/profile.py
parentf927fb6e6a17123c05c6595bbdb45ed771596ab9 (diff)
Fix 2215 | Display installed packages for all profile submenus (#2355)
* Display all packages to be installed * Display all packages to be installed
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