Ejemplo n.º 1
0
def do_bid(args):
    '''Subcommand to bid .  Calls client class to do the bidding'''
    privkeyfile = _get_private_keyfile(KEY_NAME)
    client = CookieJarClient(base_url=DEFAULT_URL, key_file=privkeyfile)
    s_name = args.supplier_name
    response = client.bake(args.amount, s_name)
    print("Bid Response: {}".format(response))
Ejemplo n.º 2
0
def do_count():
    '''Subcommand to find winner of .  Calls client class to do the counting.'''
    privkeyfile = _get_private_keyfile(KEY_NAME)
    client = CookieJarClient(base_url=DEFAULT_URL, key_file=privkeyfile)
    data = client.count()
    if data is not None:
        print("\nThe winner of the auction is {} .\n".format(data.decode()))
    else:
        raise Exception("auction data not found")
Ejemplo n.º 3
0
def do_eat(args):
    '''Subcommand to eat cookies.  Calls client class to do the eating.'''
    privkeyfile = _get_private_keyfile(KEY_NAME)
    client = CookieJarClient(base_url=DEFAULT_URL, key_file=privkeyfile)
    response = client.eat(args.amount)
    print("Eat Response: {}".format(response))
Ejemplo n.º 4
0
def do_clear():
    '''Subcommand to empty cookie jar. Calls client class to do the clearing.'''
    privkeyfile = _get_private_keyfile(KEY_NAME)
    client = CookieJarClient(base_url=DEFAULT_URL, key_file=privkeyfile)
    response = client.clear()
    print("Clear Response: {}".format(response))