Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/storage.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-11-29 20:17:21 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-11-29 20:17:21 +0000
commit607de557f9d357758730da6d6decd651d92d845b (patch)
tree333a852617f2024c1205e8aa4e74c3720ada92b2 /archinstall/lib/storage.py
parent77e37823748acc30ea74d75da2c7d20dca4acfcd (diff)
Removed find_examples() and moved example finding paths into archinstall.storage. Otherwise they won't share the variable instance across imports (mutables vs non-mutables i guess). In an attempt to fix #62
Diffstat (limited to 'archinstall/lib/storage.py')
-rw-r--r--archinstall/lib/storage.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/archinstall/lib/storage.py b/archinstall/lib/storage.py
index 11ceafee..7c2c2661 100644
--- a/archinstall/lib/storage.py
+++ b/archinstall/lib/storage.py
@@ -1,17 +1,19 @@
import os
-storage = {}
-
# There's a few scenarios of execution:
# 1. In the git repository, where ./profiles/ exist
# 2. When executing from a remote directory, but targeted a script that starts from the git repository
# 3. When executing as a python -m archinstall module where profiles exist one step back for library reasons.
# (4. Added the ~/.config directory as a additional option for future reasons)
-PROFILE_PATH = [
- './profiles',
- '~/.config/archinstall/profiles',
- os.path.join(os.path.dirname(os.path.abspath(__file__)), 'profiles'),
- os.path.abspath(f'{os.path.dirname(__file__)}/../examples')
-]
-UPSTREAM_URL = 'https://raw.githubusercontent.com/Torxed/archinstall/master/profiles'
-PROFILE_DB = None # Used in cases when listing profiles is desired, not mandatory for direct profile grabing. \ No newline at end of file
+#
+# And Keeping this in dict ensures that variables are shared across imports.
+storage = {
+ 'PROFILE_PATH' : [
+ './profiles',
+ '~/.config/archinstall/profiles',
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), 'profiles'),
+ os.path.abspath(f'{os.path.dirname(__file__)}/../examples')
+ ],
+ 'UPSTREAM_URL' : 'https://raw.githubusercontent.com/Torxed/archinstall/master/profiles',
+ 'PROFILE_DB' : None # Used in cases when listing profiles is desired, not mandatory for direct profile grabing.
+}