index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-06-02 22:59:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 22:59:31 +0200 |
commit | bedc5cd13277e23141fbd1b491e14ffde106d9f5 (patch) | |
tree | 1f20ca3e1fe648cb466274ae8dc9cad4127bd06d /archinstall/lib/profiles.py | |
parent | 7b0863f2899812607f064c0b76c9347410302726 (diff) | |
parent | 81269b972c07fefe7cc7bcc923b5f8189bc757df (diff) |
-rw-r--r-- | archinstall/lib/profiles.py | 12 |
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index d4913e7e..8434a0ab 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -228,6 +228,18 @@ class Profile(Script): # since developers like less code - omitting it should assume they want to present it. return True + def get_profile_description(self): + with open(self.path, 'r') as source: + source_data = source.read() + + if '__description__' in source_data: + with self.load_instructions(namespace=f"{self.namespace}.py") as imported: + if hasattr(imported, '__description__'): + return imported.__description__ + + # Default to this string if the profile does not have a description. + return "This profile does not have the __description__ attribute set." + @property def packages(self) -> Optional[list]: """ |