mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
1256dffcd3
commit
38afcaad7b
12
utils.py
12
utils.py
|
@ -670,7 +670,7 @@ def save_json(json_object: {}, filename: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def load_json(filename: str, delaySec: int = 2, max_tries: int = 5) -> {}:
|
def load_json(filename: str, delay_sec: 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
|
||||||
|
@ -683,14 +683,14 @@ def load_json(filename: str, delaySec: int = 2, max_tries: int = 5) -> {}:
|
||||||
break
|
break
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('EX: load_json exception ' + str(filename))
|
print('EX: load_json exception ' + str(filename))
|
||||||
if delaySec > 0:
|
if delay_sec > 0:
|
||||||
time.sleep(delaySec)
|
time.sleep(delay_sec)
|
||||||
tries += 1
|
tries += 1
|
||||||
return jsonObject
|
return jsonObject
|
||||||
|
|
||||||
|
|
||||||
def load_json_onionify(filename: str, domain: str, onion_domain: str,
|
def load_json_onionify(filename: str, domain: str, onion_domain: str,
|
||||||
delaySec: int = 2) -> {}:
|
delay_sec: int = 2) -> {}:
|
||||||
"""Makes a few attempts to load a json formatted file
|
"""Makes a few attempts to load a json formatted file
|
||||||
This also converts the domain name to the onion domain
|
This also converts the domain name to the onion domain
|
||||||
"""
|
"""
|
||||||
|
@ -708,8 +708,8 @@ def load_json_onionify(filename: str, domain: str, onion_domain: str,
|
||||||
break
|
break
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('EX: load_json_onionify exception ' + str(filename))
|
print('EX: load_json_onionify exception ' + str(filename))
|
||||||
if delaySec > 0:
|
if delay_sec > 0:
|
||||||
time.sleep(delaySec)
|
time.sleep(delay_sec)
|
||||||
tries += 1
|
tries += 1
|
||||||
return jsonObject
|
return jsonObject
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue