Esempio n. 1
0
def prompt_new_cloud_app_account():
    
    # Have the user give us their username/password
    print "---------------"
    print "I need to store your Cloudapp username/password for URL shortening."
    print "(FYI: These will be stored in the clear in your local mongoDB.)"

    username = string_prompt("Enter your Cloudapp username:"******"Enter your Cloudapp password:"******"username": username,
            "password": password,
            "default": True,
            })

    # This will confirm that auth works:
    test_client = CloudAppClient.get(account=account)

    # Save the account to mongo and return it:
    account.save()

    print ""
    print "CloudApp Account successfully stored!"
    print ""

    return account