index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Daniel Girtler <girtler.daniel@gmail.com> | 2024-03-08 00:43:51 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 14:43:51 +0100 |
commit | 08a6d402c4792cae95aec196460dc67aadd86f3c (patch) | |
tree | a646e7f2366387750208bbd25d4e06b0f191d9d3 /archinstall/default_profiles/profile.py | |
parent | f927fb6e6a17123c05c6595bbdb45ed771596ab9 (diff) |
-rw-r--r-- | archinstall/default_profiles/profile.py | 31 |
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 |