From 6e13b8b73572f9c0ac9b5c683b98a475afbeab38 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 15 Aug 2018 13:13:17 +0200 Subject: yapf -rip on plugins --- plugins/cyber.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/cyber.py') diff --git a/plugins/cyber.py b/plugins/cyber.py index cb6e0371..c7d4aba7 100644 --- a/plugins/cyber.py +++ b/plugins/cyber.py @@ -21,9 +21,9 @@ from poezio.plugin import BasePlugin from random import choice, randint import re - DEFAULT_CONFIG = {'cyber': {'frequency': 10}} + class Plugin(BasePlugin): default_config = DEFAULT_CONFIG @@ -34,7 +34,9 @@ class Plugin(BasePlugin): def cyberize(self, msg, tab): if randint(1, 100) > self.config.get('frequency'): return - words = [word for word in re.split('\W+', msg['body']) if len(word) > 3] + words = [ + word for word in re.split('\W+', msg['body']) if len(word) > 3 + ] if words: word = choice(words) msg['body'] = msg['body'].replace(word, 'cyber' + word) -- cgit v1.2.3