wtf_plugin: fix behaviour when a parameter is missing
authorMikael Berthe <mikael@lilotux.net>
Tue, 01 May 2007 13:33:46 +0200
changeset 4 3454a7b7c818
parent 3 a31feeace094
child 5 0cc11f58b34e
wtf_plugin: fix behaviour when a parameter is missing
plugins/wtf_plugin.py
--- a/plugins/wtf_plugin.py	Tue May 01 12:54:15 2007 +0200
+++ b/plugins/wtf_plugin.py	Tue May 01 13:33:46 2007 +0200
@@ -5,6 +5,13 @@
 WTF_FILE = 'static/wtf.txt'
 
 def handler_wtf(type, source, parameters):
+	parameters = parameters.rstrip()
+	parameters = parameters.lstrip()
+
+	if parameters == '':
+		smsg(type, source, "Gimme an acronym!")
+		return;
+
 	#acronyms = open(WTF_FILE, 'r').readlines()
 
 	word = string.upper(parameters)+"\t"