Beispiel #1
0
def check_firmware_update():
    global fw_ver_string
    fw_ver_string = fw_ver_string.replace('FW V',
                                          '').replace('\r',
                                                      '').replace('\n', '')
    fw_result = check_update.get_firmware_update_status(fw_ver_string)
    if fw_result == 0:
        firmware_update_str_label.config(text='Firmware (' +
                                         str(fw_ver_string) + '): Up to date',
                                         fg='black',
                                         bg='gray95')
        firmware_update_str_label.unbind("<Button-1>")
    elif fw_result == 1:
        firmware_update_str_label.config(text='Firmware (' +
                                         str(fw_ver_string) +
                                         '): Update available! Click me!',
                                         fg='black',
                                         bg='orange',
                                         cursor="hand2")
        firmware_update_str_label.bind("<Button-1>", fw_update_click)
    else:
        firmware_update_str_label.config(text='Firmware: Unknown',
                                         fg='black',
                                         bg='gray95')
        firmware_update_str_label.unbind("<Button-1>")
Beispiel #2
0
def check_firmware_update():
    fw_ver_string = str(daytripper_config.fw_version_major) + '.' + str(
        daytripper_config.fw_version_minor) + '.' + str(
            daytripper_config.fw_version_patch)
    firmware_update_str_label.place(x=10, y=19)
    fw_result = check_update.get_firmware_update_status(fw_ver_string)
    if fw_result == 0:
        firmware_update_str_label.config(text='Firmware (' +
                                         str(fw_ver_string) + '): Up to date',
                                         fg='black',
                                         bg='gray95')
        firmware_update_str_label.unbind("<Button-1>")
    elif fw_result == 1:
        firmware_update_str_label.config(text='Firmware (' +
                                         str(fw_ver_string) +
                                         '): Update available! Click me!',
                                         fg='black',
                                         bg='orange',
                                         cursor="hand2")
        firmware_update_str_label.bind("<Button-1>", fw_update_click)
    else:
        firmware_update_str_label.config(text='Firmware: Unknown',
                                         fg='black',
                                         bg='gray95')
        firmware_update_str_label.unbind("<Button-1>")
Beispiel #3
0
def check_firmware_update():
    filelist = os.listdir(dp_root_folder_path)
    if 'last_profile.kbd' in filelist and 'dp_stats.txt' not in filelist:
        return 1, None
    if 'dp_stats.txt' in filelist:
        with open(os.path.join(dp_root_folder_path, 'dp_stats.txt')) as dp_stats_file:
            for line in dp_stats_file:
                if line.startswith('fw '):
                    line = line.replace('\n', '').replace('\r', '').replace('fw ', '')
                    return check_update.get_firmware_update_status(line), line
    return 2, None
def print_fw_update_label(this_version):
    # print("def print_fw_update_label(this_version):")
    logging.info("def print_fw_update_label(this_version):")
    fw_result = check_update.get_firmware_update_status(this_version)
    if fw_result == 0:
        dp_fw_update_label.config(text='duckyPad firmware (' + str(this_version) +'): Up to date', fg='black', bg=default_button_color)
        dp_fw_update_label.unbind("<Button-1>")
    elif fw_result == 1:
        dp_fw_update_label.config(text='duckyPad firmware (' + str(this_version) +'): Update available! Click me!', fg='black', bg='orange', cursor="hand2")
        dp_fw_update_label.bind("<Button-1>", fw_update_click)
    else:
        dp_fw_update_label.config(text='duckyPad firmware: Unknown', fg='black', bg=default_button_color)
        dp_fw_update_label.unbind("<Button-1>")