From 6af90f396b2f66614b75a03cecd70cbd9861498c Mon Sep 17 00:00:00 2001 From: Dabo Ross Date: Thu, 16 Jun 2016 16:11:42 -0700 Subject: [PATCH] Format foods.py. This fixes the file erroring on load, introduced by my merging of the biscuit command. --- plugins/foods.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/plugins/foods.py b/plugins/foods.py index 4adcaf82a..767a484a8 100644 --- a/plugins/foods.py +++ b/plugins/foods.py @@ -1,8 +1,9 @@ -import codecs +import asyncio import json + +import codecs import os import random -import asyncio import re from cloudbot import hook @@ -16,11 +17,12 @@ cookies = ['Chocolate Chip', 'Oatmeal', 'Sugar', 'Oatmeal Raisin', 'Macadamia Nut', 'Jam Thumbprint', 'Medican Wedding', 'Biscotti', 'Oatmeal Cranberry', 'Chocolate Fudge', 'Peanut Butter', 'Pumpkin', 'Lemon Bar', 'Chocolate Oatmeal Fudge', 'Toffee Peanut', 'Danish Sugar', 'Triple Chocolate', 'Oreo'] - -biscuits = ['Digestive', 'Chocolate Digestive', 'Caramel Digestive', 'Hobnob', 'Chocolate Hobnob', 'Rich Tea Finger', 'Rich Tea', - 'Custard Cream', 'Chocolate Finger', 'Ginger Nut', 'Penguin Bar', 'Fruit Shortcake', 'Caramel Wafer', 'Shortbread Round', - 'Lemon Puff', 'Elite Chocolate Tea Cake', 'Club Bar', 'Garbaldi', 'Viennese', 'Bourbon Cream', 'Malted Milk', 'Lotus Biscoff', - 'Nice', 'Fig Roll', 'Jammie Dodger', 'Oatie', 'Jaffa Cake'] + +biscuits = ['Digestive', 'Chocolate Digestive', 'Caramel Digestive', 'Hobnob', 'Chocolate Hobnob', 'Rich Tea Finger', + 'Rich Tea', 'Custard Cream', 'Chocolate Finger', 'Ginger Nut', 'Penguin Bar', 'Fruit Shortcake', + 'Caramel Wafer', 'Shortbread Round', 'Lemon Puff', 'Elite Chocolate Tea Cake', 'Club Bar', 'Garbaldi', + 'Viennese', 'Bourbon Cream', 'Malted Milk', 'Lotus Biscoff', 'Nice', 'Fig Roll', 'Jammie Dodger', 'Oatie', + 'Jaffa Cake'] # Hey guys, any good ideas for plugins? # I don't know, something that lists every potato known to man? @@ -65,6 +67,7 @@ def is_valid(target): else: return False + @hook.on_start() def load_foods(bot): """ @@ -135,17 +138,16 @@ def cookie(text, action): action("{} {} a {} {} {} cookie and serves it with a {}!".format(method, user, flavor, size, cookie_type, side_dish)) - - + + @asyncio.coroutine @hook.command def biscuit(text, action): """ - gives a biscuit""" user = text.strip() - - name = random.choice(['bickie', 'biscuit']) - flavor = random.choice(['tasty', 'delectable', 'delicious', 'yummy', 'gorgeous', 'scrumptious', 'luscious', 'irresistible', 'mouth watering']) - + name = random.choice(['bickie', 'biscuit']) + flavor = random.choice(['tasty', 'delectable', 'delicious', 'yummy', 'gorgeous', 'scrumptious', 'luscious', + 'irresistible', 'mouth watering']) if not is_valid(user): return "I can't give a {} {} to that user.".format(flavor, name) @@ -170,6 +172,7 @@ def sandwich(text, action): # act out the message action(generator.generate_string()) + @asyncio.coroutine @hook.command def taco(text, action):