From b2a8fd985746a06ccbdfe87f7f1d4c780fdaaabc Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 4 Aug 2020 14:50:36 +0200 Subject: Adding description handling in profiles. --- archinstall/lib/profiles.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index 0e76ba3d..4e14ea67 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -20,7 +20,13 @@ def list_profiles(base='./profiles/'): for root, folders, files in os.walk(base): for file in files: if os.path.splitext(file)[1] == '.py': - cache[file] = os.path.join(root, file) + description = '' + with open(os.path.join(root, file), 'r') as fh: + first_line = fh.readline() + if first_line[0] == '#': + description = first_line.strip() + + cache[file] = {'path' : os.path.join(root, file), 'description' : ''} break return cache -- cgit v1.2.3-70-g09d2