change:
appengine/google_appengine/google/appengine/tools/appcfg.py
add the following in the parser.add_option section:
parser.add_option("-p","--password", action="store", dest="password",
metavar="PASSWORD", default=None,
help="The password")
Then modify the GetUserCredentials function:
def GetUserCredentials():
"""Prompts the user for a username and password."""
email = self.options.email
if email is None:
email = self.raw_input_fn("Email: ")
password = self.options.password
if password is None:
password = self.raw_input_fn("Password: ")
# password_prompt = "Password for %s: " % email
# if self.options.passin:
# password = self.raw_input_fn(password_prompt)
# else:
# password = self.password_input_fn(password_prompt)
return (email, password)
That's it, now you can call:
appcfg.py update demos/guestbook --email=email@gmail.com --password=xxxx
And how about:
ReplyDeleteecho "your secret password" | appcfg.py update demos/guestbook --email=email@gmail.com --passin
I was totally psyched to see this and used it, ad it worked. It seemed odd, though, that Google would not have done something like this. Thoose people hate typing passwords as next as the next person. Here's why they didn't.
ReplyDeletehttps://developers.google.com/appengine/docs/python/tools/uploadinganapp shows that if you do this:
appcfg.py --oauth2 update myapp/
your authentication will be saved and you won't have to log in again. It also has the advantage of not putting your password where other people can see it (e.g., ps -ax).