From 9db54786f095bc8b6679df8453d1356cd017e8fc Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 29 Nov 2020 19:49:55 +0000 Subject: Removed unreliable find_examples() and will use list_profiles() instead, as it covers a wider range of profiles and search area. --- archinstall/lib/profiles.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'archinstall/lib/profiles.py') diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index a5065d4a..021c48d6 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -64,25 +64,10 @@ def list_profiles(filter_irrelevant_macs=True): return cache -def find_examples(): - """ - Used to locate the examples, bundled with the module or executable. - - :return: {'guided.py' : './examples/guided.py', '' : ''} - :rtype: dict - """ - - # We need to traverse backwards one step with /../ because - # We're living in src/lib/ and we're not executing from src/ anymore. - cwd = os.path.abspath(f'{os.path.dirname(__file__)}/../') - examples = f"{cwd}/examples" - - return {os.path.basename(path): path for path in glob.glob(f'{examples}/*.py')} - def find_installation_script(profile): parsed_url = urllib.parse.urlparse(profile) if not parsed_url.scheme: - examples = find_examples() + examples = list_profiles() if f"{profile}.py" in examples: with open(examples[f"{profile}.py"]) as file: return Script(file.read(), filename=os.path.basename(profile)+".py") -- cgit v1.2.3-70-g09d2