Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-09 23:39:11 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-09 23:39:11 +0100
commite2aeb3a32faa397db899f4105a16f31a095387be (patch)
tree007129425274e4efee38622c8cf5f912074a5531 /archinstall/lib/general.py
parent48e9f13f0105e449c95e52672d1bf98e6e6b5d65 (diff)
parentcfbaaedb17e9ad6975a5bb37095e2b4ebe8e6797 (diff)
Mergining in PR #112. Reworked partitioning and added new functions
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index dc94b063..e87e4102 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -37,6 +37,7 @@ class JSON_Encoder:
## We'll need to iterate not just the value that default() usually gets passed
## But also iterate manually over each key: value pair in order to trap the keys.
+ copy = {}
for key, val in list(obj.items()):
if isinstance(val, dict):
val = json.loads(json.dumps(val, cls=JSON)) # This, is a EXTREMELY ugly hack..
@@ -44,9 +45,12 @@ class JSON_Encoder:
# trigger a encoding of sub-dictionaries.
else:
val = JSON_Encoder._encode(val)
- del(obj[key])
- obj[JSON_Encoder._encode(key)] = val
- return obj
+
+ if type(key) == str and key[0] == '!':
+ copy[JSON_Encoder._encode(key)] = '******'
+ else:
+ copy[JSON_Encoder._encode(key)] = val
+ return copy
elif hasattr(obj, 'json'):
return obj.json()
elif hasattr(obj, '__dump__'):