Fix PEP8 compliance in example plugins and rtmbot
This commit is contained in:
parent
6052333c64
commit
25ce082eac
6 changed files with 33 additions and 22 deletions
|
@ -6,19 +6,21 @@ crontabs = []
|
|||
|
||||
tasks = {}
|
||||
|
||||
FILE="plugins/todo.data"
|
||||
|
||||
FILE = "plugins/todo.data"
|
||||
if os.path.isfile(FILE):
|
||||
tasks = pickle.load(open(FILE, 'rb'))
|
||||
|
||||
|
||||
def process_message(data):
|
||||
global tasks
|
||||
channel = data["channel"]
|
||||
text = data["text"]
|
||||
#only accept tasks on DM channels
|
||||
# only accept tasks on DM channels
|
||||
if channel.startswith("D"):
|
||||
if channel not in tasks.keys():
|
||||
tasks[channel] = []
|
||||
#do command stuff
|
||||
# do command stuff
|
||||
if text.startswith("todo"):
|
||||
tasks[channel].append(text[5:])
|
||||
outputs.append([channel, "added"])
|
||||
|
@ -36,4 +38,4 @@ def process_message(data):
|
|||
tasks[channel].pop(num)
|
||||
if text == "show":
|
||||
print tasks
|
||||
pickle.dump(tasks, open(FILE,"wb"))
|
||||
pickle.dump(tasks, open(FILE, "wb"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue