summaryrefslogtreecommitdiff
path: root/plugins/figlet.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-07 19:48:16 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-07 19:48:16 +0100
commit54962e6796301f6fb57d09f7778ab50f69e35943 (patch)
treec1312f5cdc386970079f776b0477a24da0d9b599 /plugins/figlet.py
parent04f103b9e67ccd1de7376be4f7b5156ec425e99c (diff)
parent17e5411d8f050a3c5e5bcd010551eecac96b5911 (diff)
downloadpoezio-54962e6796301f6fb57d09f7778ab50f69e35943.tar.gz
poezio-54962e6796301f6fb57d09f7778ab50f69e35943.tar.bz2
poezio-54962e6796301f6fb57d09f7778ab50f69e35943.tar.xz
poezio-54962e6796301f6fb57d09f7778ab50f69e35943.zip
Merge branch 'plugins' of /home/louiz/git/poezio into plugins
Conflicts: src/core.py
Diffstat (limited to 'plugins/figlet.py')
-rw-r--r--plugins/figlet.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/figlet.py b/plugins/figlet.py
new file mode 100644
index 00000000..ccff687a
--- /dev/null
+++ b/plugins/figlet.py
@@ -0,0 +1,11 @@
+from plugin import BasePlugin
+import subprocess
+
+class Plugin(BasePlugin):
+ def init(self):
+ self.add_poezio_event_handler('muc_say', self.figletize)
+
+ def figletize(self, msg):
+ process = subprocess.Popen(['figlet', msg['body']], stdout=subprocess.PIPE)
+ result = process.communicate()[0].decode('utf-8')
+ msg['body'] = result