mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
0a2cb81a29
commit
4a78effa88
4
utils.py
4
utils.py
|
@ -670,12 +670,12 @@ def save_json(json_object: {}, filename: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def load_json(filename: str, delaySec: int = 2, maxTries: int = 5) -> {}:
|
def load_json(filename: str, delaySec: int = 2, max_tries: int = 5) -> {}:
|
||||||
"""Makes a few attempts to load a json formatted file
|
"""Makes a few attempts to load a json formatted file
|
||||||
"""
|
"""
|
||||||
jsonObject = None
|
jsonObject = None
|
||||||
tries = 0
|
tries = 0
|
||||||
while tries < maxTries:
|
while tries < max_tries:
|
||||||
try:
|
try:
|
||||||
with open(filename, 'r') as fp:
|
with open(filename, 'r') as fp:
|
||||||
data = fp.read()
|
data = fp.read()
|
||||||
|
|
Loading…
Reference in New Issue