todo example persists data now

This commit is contained in:
Ryan Huber 2014-11-21 21:25:27 -08:00
parent 8cd6b04053
commit ddabcfa8e1

View file

@ -1,8 +1,15 @@
import os
import pickle
outputs = []
crontabs = []
tasks = {}
FILE="plugins/todo.data"
if os.path.isfile(FILE):
tasks = pickle.load(open(FILE, 'rb'))
def process_message(data):
global tasks
channel = data["channel"]
@ -29,3 +36,4 @@ def process_message(data):
tasks[channel].pop(num)
if text == "show":
print tasks
pickle.dump(tasks, open(FILE,"wb"))