mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
test
This commit is contained in:
parent
bde826861d
commit
e0ef5a63f9
@ -61,17 +61,17 @@ class BotRead():
|
|||||||
|
|
||||||
# Read dictionary from file, if not, enable an empty dict
|
# Read dictionary from file, if not, enable an empty dict
|
||||||
filereadgood = True
|
filereadgood = True
|
||||||
|
try:
|
||||||
inf = codecs.open(filepath, "r", encoding='utf-8')
|
inf = codecs.open(filepath, "r", encoding='utf-8')
|
||||||
infread = inf.read()
|
infread = inf.read()
|
||||||
try:
|
# Close File
|
||||||
|
inf.close()
|
||||||
dict_from_file = eval(infread)
|
dict_from_file = eval(infread)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
filereadgood = False
|
filereadgood = False
|
||||||
if logging:
|
if logging:
|
||||||
logs.log(log_from, "Error loading %s: %s (%s)" % (configtypename, e, filepath))
|
logs.log(log_from, "Error loading %s: %s (%s)" % (configtypename, e, filepath))
|
||||||
dict_from_file = dict()
|
dict_from_file = dict()
|
||||||
# Close File
|
|
||||||
inf.close()
|
|
||||||
|
|
||||||
# gather file stats
|
# gather file stats
|
||||||
slashsplit = str(filepath).split("/")
|
slashsplit = str(filepath).split("/")
|
||||||
@ -112,17 +112,17 @@ class BotRead():
|
|||||||
|
|
||||||
# Read dictionary from file, if not, enable an empty dict
|
# Read dictionary from file, if not, enable an empty dict
|
||||||
filereadgood = True
|
filereadgood = True
|
||||||
|
try:
|
||||||
inf = codecs.open(jsonpath, "r", encoding='utf-8')
|
inf = codecs.open(jsonpath, "r", encoding='utf-8')
|
||||||
infread = inf.read()
|
infread = inf.read()
|
||||||
try:
|
|
||||||
dict_from_file = eval(infread)
|
dict_from_file = eval(infread)
|
||||||
|
# Close File
|
||||||
|
inf.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
filereadgood = False
|
filereadgood = False
|
||||||
if logging:
|
if logging:
|
||||||
logs.log("SpiceBot_Modules", "Error loading %s: %s (%s)" % ("Module Commands", e, jsonpath))
|
logs.log("SpiceBot_Modules", "Error loading %s: %s (%s)" % ("Module Commands", e, jsonpath))
|
||||||
dict_from_file = dict()
|
dict_from_file = dict()
|
||||||
# Close File
|
|
||||||
inf.close()
|
|
||||||
|
|
||||||
# gather file stats
|
# gather file stats
|
||||||
slashsplit = str(filepath).split("/")
|
slashsplit = str(filepath).split("/")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user