F
Fred Murray
Hi all,
I've been looking around for a utility that will let me do something like this:
while 1:
# Ask user for username and password
username, password = user_session.form_input(LOGIN_SCREEN)
# If username is invalid, warn user and ask again
if username not in users:
user_session.print(INVALID_USERNAME)
continue
# If password is invalid, warn user and ask again
if users[username] != password:
user_session.print(INVALID_PASSWORD)
continue
# If username and password match, then break out of loop
break
# (code to log in user goes here...)
In other words, I'm looking for a package that will use cookies or CGI
variables to save the state of the program in between HTTP requests. Packages
like Albatross seem to require class definitions for each page, which isn't
as natural or convenient as treating an HTML form as an input function (like
raw_input()).
If anyone knows if anything like this is available, thanks for letting me know!
I've been looking around for a utility that will let me do something like this:
while 1:
# Ask user for username and password
username, password = user_session.form_input(LOGIN_SCREEN)
# If username is invalid, warn user and ask again
if username not in users:
user_session.print(INVALID_USERNAME)
continue
# If password is invalid, warn user and ask again
if users[username] != password:
user_session.print(INVALID_PASSWORD)
continue
# If username and password match, then break out of loop
break
# (code to log in user goes here...)
In other words, I'm looking for a package that will use cookies or CGI
variables to save the state of the program in between HTTP requests. Packages
like Albatross seem to require class definitions for each page, which isn't
as natural or convenient as treating an HTML form as an input function (like
raw_input()).
If anyone knows if anything like this is available, thanks for letting me know!