import account

def ask_enable(list_ask):
    enable = list(list_ask)
    enable.extend('1'.zfill(2))
    enable.extend('$')
    return enable

def ask_distance(list_ask):
    distance = list(list_ask)
    distance.extend('2'.zfill(2))
    distance.extend('$')
    return distance

def read_enable(client_id, recieved_list):
    id_ = int(recieved_list[0] + recieved_list[1])
    func_ = int(recieved_list[2] + recieved_list[3])

    if client_id == id_:
        if func_ == 1:
            return bool(int(recieved_list[4]))
        return "ID: {}, Wrong function!".format(client_id)
    return "Wrong client ID!"

def read_distance(client_id, recieved_list):
    id_ = int(recieved_list[0] + recieved_list[1])
    func_ = int(recieved_list[2] + recieved_list[3])

    if client_id == id_:
        if func_ == 2:
            dist_ = int(recieved_list[4] + recieved_list[5] + recieved_list[6])
            return dist_
        return "ID: {}, Wrong function!".format(client_id)
    return "Wrong client ID!"