Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-02-17 14:21:46 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-02-17 14:21:46 +0100
commitad4733bbd0b0e889ad902a7d954ec985fc7a24fe (patch)
treea0f4feaa14fd9fc87d4b3572f9efbd796291ba37 /examples
parent758b12e6746ac76c57e7725d4e35abbb4805ad23 (diff)
Simplified profile prep-execution slightly in guided.py. The code can be improved further but it's now more easily read what's going on.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 1758a397..4cd37972 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -185,15 +185,15 @@ else:
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
# Check the potentially selected profiles preperations to get early checks if some additional questions are needed.
-print(archinstall.arguments['profile'])
-if archinstall.arguments['profile']:
- if not archinstall.arguments['profile']._prep_function():
- archinstall.log(
- ' * Profile\'s preparation requirements was not fulfilled.',
- bg='black',
- fg='red'
- )
- exit(1)
+if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_prep_function():
+ with archinstall.arguments['profile'].load_instructions(namespace=f"{archinstall.arguments['profile'].namespace}.py") as imported:
+ if not imported._prep_function():
+ archinstall.log(
+ ' * Profile\'s preparation requirements was not fulfilled.',
+ bg='black',
+ fg='red'
+ )
+ exit(1)
# Additional packages (with some light weight error handling for invalid package names)
if not archinstall.arguments.get('packages', None):