From 7e1da4fb50fcf10071657bc4c120593930529c9d Mon Sep 17 00:00:00 2001 From: sco1 Date: Tue, 19 Mar 2019 13:28:48 -0400 Subject: Docstring pass for Halloween cogs --- bot/utils/halloween/spookifications.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'bot/utils') diff --git a/bot/utils/halloween/spookifications.py b/bot/utils/halloween/spookifications.py index 5f2369ae..390cfa49 100644 --- a/bot/utils/halloween/spookifications.py +++ b/bot/utils/halloween/spookifications.py @@ -8,17 +8,20 @@ log = logging.getLogger() def inversion(im): - """Inverts an image. + """ + Inverts the image. Returns an inverted image when supplied with an Image object. """ + im = im.convert('RGB') inv = ImageOps.invert(im) return inv def pentagram(im): - """Adds pentagram to image.""" + """Adds pentagram to the image.""" + im = im.convert('RGB') wt, ht = im.size penta = Image.open('bot/resources/halloween/bloody-pentagram.png') @@ -28,10 +31,13 @@ def pentagram(im): def bat(im): - """Adds a bat silhoutte to the image. + """ + Adds a bat silhoutte to the image. + + The bat silhoutte is of a size at least one-fifths that of the original image and may be rotated + up to 90 degrees anti-clockwise. + """ - The bat silhoutte is of a size at least one-fifths that of the original - image and may be rotated upto 90 degrees anti-clockwise.""" im = im.convert('RGB') wt, ht = im.size bat = Image.open('bot/resources/halloween/bat-clipart.png') @@ -49,6 +55,7 @@ def bat(im): def get_random_effect(im): """Randomly selects and applies an effect.""" + effects = [inversion, pentagram, bat] effect = choice(effects) log.info("Spookyavatar's chosen effect: " + effect.__name__) -- cgit v1.2.3