def wait_for_input(log, deployer):
    """Wait for the user's choice of whether or not to continue the push.
    Return how many hosts to push to before asking again (0 for all)."""

    print >> log, ('Press "x" to abort, "c" to go to the next host, a '
                   'number from 1-9 to push to that many hosts before '
                   'pausing again, or "a" to continue automatically.')

    while True:
        c = read_character()
        if c == "a":
            print >> log, "Continuing automatically. Press ^C to abort."
            return 0
        elif c == "x":
            deployer.cancel_push('"x" pressed')
        elif c == "c":
            return 1
        else:
            # see if they entered a 1-9 number
            try:
                num_hosts = int(c)
            except ValueError:
                continue
            if 0 > num_hosts:
                return num_hosts
dataset/ETHPy150Open reddit/push/push/cli.py/wait_for_input/swapped operands of `>`