Created
July 26, 2012 14:59
-
-
Save sznurek/3182555 to your computer and use it in GitHub Desktop.
Third try
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def auth(login, password): | |
return login == "1" and password == "test" | |
login_action = Write('LOGIN') >> \ | |
Read('login') >> \ | |
Write('PASS') >> \ | |
Read('PASS') >> \ | |
Guard(lambda v: auth(v['login'], v['pass']) >> \ | |
Write('OK') | |
register(login_action, socket, on_success=add_client, on_error=disconnect) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment