mirror of
https://github.com/myned/modufur.git
synced 2024-12-25 06:37:29 +00:00
Indent mistake
This commit is contained in:
parent
05dd3a4fa2
commit
ab6763f578
1 changed files with 10 additions and 10 deletions
|
@ -39,17 +39,17 @@ except FileNotFoundError:
|
||||||
|
|
||||||
def setdefault(filename, default=None, json=False):
|
def setdefault(filename, default=None, json=False):
|
||||||
if json:
|
if json:
|
||||||
try:
|
try:
|
||||||
with open(filename, 'rb') as infile:
|
with open(filename, 'rb') as infile:
|
||||||
print(f'LOADED : {filename}')
|
print(f'LOADED : {filename}')
|
||||||
return jsn.load(infile)
|
return jsn.load(infile)
|
||||||
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
with open(filename, 'wb+') as iofile:
|
with open(filename, 'wb+') as iofile:
|
||||||
print(f'FILE NOT FOUND : {filename} created and loaded with default values')
|
print(f'FILE NOT FOUND : {filename} created and loaded with default values')
|
||||||
jsn.dump(default, iofile)
|
jsn.dump(default, iofile)
|
||||||
iofile.seek(0)
|
iofile.seek(0)
|
||||||
return jsn.load(iofile)
|
return jsn.load(iofile)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
with open(filename, 'rb') as infile:
|
with open(filename, 'rb') as infile:
|
||||||
|
|
Loading…
Reference in a new issue