Exemple #1
0
    def ask_for_password():
        global my_password
        FOO.change_flow(True)
        while FOO.flow_control_is(True):
            my_password = FOO.question("""
            Now please enter your custom password.
            Create a new one if you don't have one already.

            Password: """)
            if not FOO.ANNOYANCE and my_password:
                FOO.text("""
                Oops, sorry! That was plain-text. Don't worry, this is no error, it's just that \
                I can't help it, because there's no cross-platform Python \
                function that I know of which has predictable 'asterisk' behavior.""",
                """
                Also, you're the developer, it's up to you to create your desired behavior. I'm \
                but a humble automatic TUTORIAL.""", end = "")
                FOO.ANNOYANCE = True
            elif not my_password:
                if not FOO.ANNOYANCE2:
                    FOO.text("""
                    Really!? No password? Well, we've got a badass here, your call.""", end = "")
                    FOO.ANNOYANCE2 = True
                else:
                    FOO.text("<blank password>", end = "", skip = True)
            FOO.yn_question("""
            Do you want to change your password?""")
Exemple #2
0
    def ask_for_keys(force_change = False): ## Asks for keys, what else?
        global client_id, client_secret, password, keys
        if force_change:
            FOO.change_flow(True)
        else:
            FOO.yn_question ("""\
            Do you want to set up new keys?""")
        while FOO.flow_control_is(True):
            FOO.text("""
            Please type in your keys as asked""", skip = True)
            client_id     = FOO.question ("... Client ID ..: ")
            client_secret = FOO.question (". Client Secret : ")
            password      = FOO.question ("... Password ...: ")
            keys = {'client_id': client_id, 'client_secret': client_secret, 'password': password}
            FOO.yn_question ("""\
            Do you want to make any changes to the previous keys?""")

        FOO.text("""
        Alright! It seems you have your keys ready and you're good to go!
        """)
Exemple #3
0
    ## Asking for username
    while not FOO.flow_control_is(True):
        username = FOO.question("""
        Now please enter your username: """)
        while not username:
            FOO.text("Name cannot be blank.", skip = True)
            username = FOO.question("""
            Now please enter your username: """)
        FOO.text("""
        Nice to meet you {username}.""".format(username = username), skip = True)
        if not FOO.ANNOYANCE:
            FOO.text("""\
            I am TUTORIAL, and as you can see, I'm a very basic user interface.""", skip = True)
            FOO.ANNOYANCE = True
        FOO.yn_question("""Are you sure your username is correct?""")


    FOO.text("""
    The next step is to attempt retrieving your keys using retrieve_keys(). This function automatically calls \
    the function that retrieves the keys location and does all the interpretation.""",
    """
    However for the purpose of this tutorial, I'll check step by step, which will be redundant but self explanatory.
    First I'll call

    >> get_keys_directory({username})

    which will look into keys_loc.json . Beware the possible KeysDirectoryNotFound.


    """.format(username = repr(username)), end = "")