Exemple #1
0
def edit_overrides(new, upload, session):
    print
    done = 0
    while not done:
        print_new(upload, new, indexed=1, session=session)
        prompt = "edit override <n>, Editor, Done ? "

        got_answer = 0
        while not got_answer:
            answer = utils.our_raw_input(prompt)
            if not answer.isdigit():
                answer = answer[:1].upper()
            if answer == "E" or answer == "D":
                got_answer = 1
            elif re_isanum.match(answer):
                answer = int(answer)
                if answer < 1 or answer > len(new):
                    print "{0} is not a valid index.  Please retry.".format(
                        answer)
                else:
                    got_answer = 1

        if answer == 'E':
            new = edit_new(new, upload, session)
        elif answer == 'D':
            done = 1
        else:
            edit_index(new, upload, answer - 1)

    return new
Exemple #2
0
def edit_overrides (new, upload, session):
    print
    done = 0
    while not done:
        print_new (upload, new, indexed=1, session=session)
        prompt = "edit override <n>, Editor, Done ? "

        got_answer = 0
        while not got_answer:
            answer = utils.our_raw_input(prompt)
            if not answer.isdigit():
                answer = answer[:1].upper()
            if answer == "E" or answer == "D":
                got_answer = 1
            elif re_isanum.match (answer):
                answer = int(answer)
                if answer < 1 or answer > len(new):
                    print "{0} is not a valid index.  Please retry.".format(answer)
                else:
                    got_answer = 1

        if answer == 'E':
            new = edit_new(new, upload, session)
        elif answer == 'D':
            done = 1
        else:
            edit_index (new, upload, answer - 1)

    return new
Exemple #3
0
def edit_overrides (new, upload, session):
    print
    done = 0
    while not done:
        print_new (new, upload, indexed=1)
        new_index = {}
        index = 0
        for i in new.keys():
            index += 1
            new_index[index] = i

        prompt = "(%s) edit override <n>, Editor, Done ? " % (index_range(index))

        got_answer = 0
        while not got_answer:
            answer = utils.our_raw_input(prompt)
            if not answer.isdigit():
                answer = answer[:1].upper()
            if answer == "E" or answer == "D":
                got_answer = 1
            elif re_isanum.match (answer):
                answer = int(answer)
                if (answer < 1) or (answer > index):
                    print "%s is not a valid index (%s).  Please retry." % (answer, index_range(index))
                else:
                    got_answer = 1

        if answer == 'E':
            edit_new(new, upload)
        elif answer == 'D':
            done = 1
        else:
            edit_index (new, upload, new_index[answer])

    return new