Skip to content

Instantly share code, notes, and snippets.

@sznurek
Created July 26, 2012 14:59
Show Gist options
  • Save sznurek/3182555 to your computer and use it in GitHub Desktop.
Save sznurek/3182555 to your computer and use it in GitHub Desktop.
Third try
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