From 256ffd5b9d593d1ea44d990f8f8809ffe51417bb Mon Sep 17 00:00:00 2001 From: neersighted Date: Thu, 1 Mar 2012 12:03:27 -0800 Subject: [PATCH] update password.py to be faster (and better (arrays!)), and add credit to lastfm.py --- plugins/lastfm.py | 1 + plugins/password.py | 17 +++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/plugins/lastfm.py b/plugins/lastfm.py index 218031e..9e7d508 100755 --- a/plugins/lastfm.py +++ b/plugins/lastfm.py @@ -1,3 +1,4 @@ +# Upgraded with tables/cacheing by ChauffeR of #freebnc on irc.esper.net from util import hook, http @hook.command('l') diff --git a/plugins/password.py b/plugins/password.py index d17b753..ba43a5d 100755 --- a/plugins/password.py +++ b/plugins/password.py @@ -52,13 +52,10 @@ def gen_password(types): @hook.command def password(inp, notice=None): - ".password [types] -- Generates a password of . [types] can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the types, eg. 'numbers symbols'" - if inp == "penis": - return "error: unable to process request, input too short!" - if inp == "mypenis": - return "error: unable to process request, input too short!" - if inp == "dick": - return "error: unable to process request, input too short!" - if inp == "mydick": - return "error: unable to process request, input too short!" - notice(gen_password(inp)) + ".password [types] -- Generates a password of . [types] can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the types, eg. 'numbers symbols'" + short = "error: input too short" + penis = ["penis", "mypenis", "dick", "mydick"] + password = gen_password(inp) + if inp in penis: + return short + notice(password)