Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/profiles.py
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-06-02 16:51:57 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-06-02 16:52:26 -0400
commitf88da816456af4c2516c678cca74a85072d8d5f1 (patch)
tree668c17d129eec12925f418cc01ab6f1d3bbef9c4 /archinstall/lib/profiles.py
parent7b0863f2899812607f064c0b76c9347410302726 (diff)
Add description to profile listing
Diffstat (limited to 'archinstall/lib/profiles.py')
-rw-r--r--archinstall/lib/profiles.py12
1 files changed, 12 insertions, 0 deletions
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]:
"""