# HG changeset patch # User Mikael Berthe # Date 1178127480 -7200 # Node ID f34555473aaf387cd18aed5d9dbf533c8df4f7ab # Parent 3f031ac4c71b5e19c278a2b75ae2132bd64d9a8e Update coding style for my modules vim:set et sts=4: (No tabs, and indents = 4 chars) diff -r 3f031ac4c71b -r f34555473aaf plugins/aspell_plugin.py --- a/plugins/aspell_plugin.py Wed May 02 14:01:53 2007 +0200 +++ b/plugins/aspell_plugin.py Wed May 02 19:38:00 2007 +0200 @@ -1,4 +1,5 @@ #$ neutron_plugin 01 +# 2007-05 Mikael Berthe import popen2 import re @@ -24,7 +25,7 @@ r = stdout.readline() for r in stdout.readlines(): - r = r.decode('iso-8859-15') + r = r.decode('iso-8859-15') if r == "*\n": reply += "* Word correctly spelled.\n" elif r.startswith("& "): @@ -40,4 +41,6 @@ smsg(type, source, reply.rstrip()) register_command_handler(handler_aspell, 'aspell', 0, 'Check the spelling', - 'aspell [lang]', ['aspell fr bonjour']) + 'aspell [lang]', ['aspell fr bonjour']) + +# vim:set et sts=4: diff -r 3f031ac4c71b -r f34555473aaf plugins/wtf_plugin.py --- a/plugins/wtf_plugin.py Wed May 02 14:01:53 2007 +0200 +++ b/plugins/wtf_plugin.py Wed May 02 19:38:00 2007 +0200 @@ -1,31 +1,32 @@ #$ neutron_plugin 01 +# 2007-05 Mikael Berthe import re WTF_FILE = 'static/wtf.txt' def handler_wtf(type, source, parameters): - parameters = parameters.rstrip(" ?\n").lstrip() - word = parameters.upper() + "\t" + parameters = parameters.rstrip(" ?\n").lstrip() + word = parameters.upper() + "\t" - if not parameters: - if type == 'private': - smsg(type, source, "Gimme an acronym!") - return + if not parameters: + if type == 'private': + smsg(type, source, "Gimme an acronym!") + return - reply = ''.join(line for line in file(WTF_FILE) \ - if line.startswith(word)) + reply = ''.join(line for line in file(WTF_FILE) if line.startswith(word)) - if not reply: - if type == 'private': - reply = "Sorry, I don't know what " + parameters + \ - " means..." - else: - return - else: - reply= re.sub("\t+", ": ", reply.rstrip()) + if not reply: + if type == 'private': + reply = "Sorry, I don't know what " + parameters + " means..." + else: + return + else: + reply= re.sub("\t+", ": ", reply.rstrip()) - smsg(type, source, reply) + smsg(type, source, reply) register_command_handler(handler_wtf, 'wtf', 0, 'Translates acronyms for you', 'wtf', ['wtf wtf']) + +# vim:set et sts=4: