apply file read/save helpers

This commit is contained in:
jomo
2014-07-27 19:42:33 +02:00
parent 2e7e021001
commit aad63e5416
10 changed files with 42 additions and 121 deletions

View File

@@ -1,17 +1,12 @@
import json
from helpers import *
from re import compile as reg_compile
answers_filename = "plugins/redstoner-utils.py.dir/files/abot.json"
answers = []
answers = []
def load_answers():
global answers
try:
answers = json.loads(open(answers_filename).read())
except Exception, e:
error("Failed to load answers: %s" % e)
answers = open_json_file("abot", [])
# compile answers
for answer in answers: