update password.py to be faster (and better (arrays!)), and add credit to lastfm.py

This commit is contained in:
neersighted 2012-03-01 12:03:27 -08:00
parent 42b4d4951a
commit 256ffd5b9d
2 changed files with 8 additions and 10 deletions

View file

@ -1,3 +1,4 @@
# Upgraded with tables/cacheing by ChauffeR of #freebnc on irc.esper.net
from util import hook, http
@hook.command('l')

View file

@ -52,13 +52,10 @@ def gen_password(types):
@hook.command
def password(inp, notice=None):
".password <length> [types] -- Generates a password of <legenth>. [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 <length> [types] -- Generates a password of <legnth>. [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)