From 5b7af12a9190bb06a4f12308f7ba1cc4c1101b6b Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Fri, 22 Jan 2021 13:53:04 +0100 Subject: Safety checks prohibited this from running The safety mechanism prevents the installation-code under `if __name__` to run when importing to check for the `_prep_function`. when the import for `_prep_function` check is executed it imports with a bogus `__name__` override. This is to protect anything under if `__name__` from running just to be able to import and run `_prep_function()`. After that is done and the actual installation begins, it imports with a proper `__name__`, The namespace is `filename` minus the `.extension` *(.py)*, normally imports of modules with dashes (`-`) in the name is prohibited, but archintall's import mechanism supports this as it's a string-import via `importlib`. So modified to `if __name__ == 'kde-wayland'` and that worked great : ) --- profiles/kde-wayland.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles/kde-wayland.py') diff --git a/profiles/kde-wayland.py b/profiles/kde-wayland.py index 66d31504..31226952 100644 --- a/profiles/kde-wayland.py +++ b/profiles/kde-wayland.py @@ -22,7 +22,7 @@ def _prep_function(*args, **kwargs): # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("kde", "/somewhere/kde.py") # or through conventional import kde -if __name__ == 'kde': +if __name__ == 'kde-wayland': # Install dependency profiles installation.install_profile('xorg') -- cgit v1.2.3-70-g09d2