Fixing a few bugs in loading settings.settings.data
This commit is contained in:
parent
40d4a019bb
commit
bbcf7764d4
1 changed files with 12 additions and 6 deletions
|
@ -26,9 +26,12 @@ def write(setting, value):
|
||||||
value = str(value)
|
value = str(value)
|
||||||
|
|
||||||
#opening the file
|
#opening the file
|
||||||
data = open("settings/settings.data")
|
try:
|
||||||
data = data.read()
|
data = open("settings/settings.data")
|
||||||
data = data.split("\n")
|
data = data.read()
|
||||||
|
data = data.split("\n")
|
||||||
|
except:
|
||||||
|
data = ["Language = Unknown"]
|
||||||
|
|
||||||
#making a new file
|
#making a new file
|
||||||
ndata = open("settings/settings.data", "w")
|
ndata = open("settings/settings.data", "w")
|
||||||
|
@ -74,9 +77,12 @@ def load_all():
|
||||||
ret = {}
|
ret = {}
|
||||||
|
|
||||||
# Opening the file.
|
# Opening the file.
|
||||||
data = open("settings/settings.data")
|
try:
|
||||||
data = data.read()
|
data = open("settings/settings.data")
|
||||||
data = data.split("\n")
|
data = data.read()
|
||||||
|
data = data.split("\n")
|
||||||
|
except:
|
||||||
|
data = ["Language = Unknown"]
|
||||||
|
|
||||||
# Parsing the file.
|
# Parsing the file.
|
||||||
for d in data:
|
for d in data:
|
||||||
|
|
Loading…
Reference in a new issue