diff options
author | mathieui <mathieui@mathieui.net> | 2018-08-15 13:13:17 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2018-08-15 13:13:17 +0200 |
commit | 6e13b8b73572f9c0ac9b5c683b98a475afbeab38 (patch) | |
tree | 7dae86588339a8cf144b2d98c9280f28646341a9 /plugins/cyber.py | |
parent | d1b624753bb5371cf287cc9d86bb685593a99315 (diff) | |
download | poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.gz poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.bz2 poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.xz poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.zip |
yapf -rip on plugins
Diffstat (limited to 'plugins/cyber.py')
-rw-r--r-- | plugins/cyber.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |