From 85f2938df9e7e34a08fd1b1acc7c8b41d14ccb54 Mon Sep 17 00:00:00 2001 From: Werner Llácer Date: Fri, 4 Feb 2022 23:48:41 +0100 Subject: Moving load_config from guided to \__init__.py (#887) * The initializations done at the start of guided.py are now at archinstall/__init__.py The scripts have been changed accordingly * Correct definition of btrfs standard layout Co-authored-by: Anton Hvornum --- examples/only_hd.py | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) (limited to 'examples/only_hd.py') diff --git a/examples/only_hd.py b/examples/only_hd.py index 755e00f5..f1bddbb2 100644 --- a/examples/only_hd.py +++ b/examples/only_hd.py @@ -5,28 +5,6 @@ import pathlib import archinstall -def load_mirror(): - if archinstall.arguments.get('mirror-region', None) is not None: - if type(archinstall.arguments.get('mirror-region', None)) is dict: - archinstall.arguments['mirror-region'] = archinstall.arguments.get('mirror-region', None) - else: - selected_region = archinstall.arguments.get('mirror-region', None) - archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} - -def load_localization(): - if archinstall.arguments.get('sys-language', None) is not None: - archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US') - if archinstall.arguments.get('sys-encoding', None) is not None: - archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8') - -def load_harddrives(): - if archinstall.arguments.get('harddrives', None) is not None: - if type(archinstall.arguments['harddrives']) is str: - archinstall.arguments['harddrives'] = archinstall.arguments['harddrives'].split(',') - archinstall.arguments['harddrives'] = [archinstall.BlockDevice(BlockDev) for BlockDev in archinstall.arguments['harddrives']] - # Temporarily disabling keep_partitions if config file is loaded - - def ask_harddrives(): # Ask which harddrives/block-devices we will install to # and convert them into archinstall.BlockDevice() objects. @@ -63,35 +41,6 @@ def ask_harddrives(): if not archinstall.arguments.get('swap', None): archinstall.arguments['swap'] = archinstall.ask_for_swap() -def load_profiles(): - if archinstall.arguments.get('profile', None) is not None: - if type(archinstall.arguments.get('profile', None)) is dict: - archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)['path']) - else: - archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)) - -def load_desktop_profiles(): - # Temporary workaround to make Desktop Environments work - archinstall.storage['_desktop_profile'] = archinstall.arguments.get('desktop-environment', None) - -def load_gfxdriver(): - if archinstall.arguments.get('gfx_driver', None) is not None: - archinstall.storage['gfx_driver_packages'] = archinstall.AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None) - -def load_servers(): - if archinstall.arguments.get('servers', None) is not None: - archinstall.storage['_selected_servers'] = archinstall.arguments.get('servers', None) - - -def load_config(): - load_harddrives() - load_profiles() - load_desktop_profiles() - load_mirror() - load_localization() - load_gfxdriver() - load_servers() - def ask_user_questions(): """ First, we'll ask the user for a bunch of user input. @@ -219,8 +168,6 @@ if not archinstall.check_mirror_reachable(): archinstall.log(f"Arch Linux mirrors are not reachable. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red") exit(1) -load_config() - if not archinstall.arguments.get('silent'): ask_user_questions() -- cgit v1.2.3-54-g00ecf