Example #1
0
def main(catch):
    results = [check_ip(ip, catch) for ip in addresses]

    for result in results:
        if not result:
            continue
        click.secho(result, fg='magenta')
Example #2
0
def check_ip_wo_catch(ip):
    gevent.sleep(random.choice(delays))
    with semaphore:
        click.secho('Acquired semaphore.', bg='white', fg='black')
        result = check_ip(ip, False)
    click.secho('Release semaphore.', bg='white', fg='black')
    return result
Example #3
0
def check_ip_wo_catch(ip):
    return check_ip(ip, False)
Example #4
0
def check_ip_w_catch(ip):
    with semaphore:
        click.secho('Acquired semaphore.', bg='white', fg='black')
        result = check_ip(ip, True)
    click.secho('Release semaphore.', bg='white', fg='black')
    return result
Example #5
0
def check_ip_w_catch(ip):
    return check_ip(ip, True)