コード例 #1
0
def write_offset_to_startup_yml():
    add.open_window('network',
                    "./Test_Data/1920x1200/template_file/control_panel.png")
    time.sleep(2)
    switch_to_vpn = NewController('desktop.png', ['system.png'], 'WINDOW',
                                  'control_panel.yml')
    switch_to_vpn.click_position_tool('vpn.png')
    edit_dict = {'switch_to_vpn': switch_to_vpn.relative_offset}
    switch_to_vpn.dump_to_yaml(edit_dict)
    enable_vpn = NewController('desktop.png', ['system.png'], 'WINDOW',
                               'control_panel.yml')
    enable_vpn.click_position_tool('auto_start.png')
    edit_dict['enable_auto_start'] = enable_vpn.relative_offset
    enable_vpn.dump_to_yaml(edit_dict)
    enable_vpn.click_position_tool('vpn_type.png')
    pyautogui.press('down')
    pyautogui.press('enter')
    pyautogui.press('tab')
    time.sleep(2)
    apply_vnc_change = NewController('desktop.png', ['control_panel.png'],
                                     'WINDOW', 'control_panel.yml')
    apply_vnc_change.click_position_tool('control_panel_apply.png')
    edit_dict['apply_vpn_change'] = apply_vnc_change.relative_offset
    apply_vnc_change.dump_to_yaml(edit_dict)
    add.close_window("./Test_Data/1920x1200/template_file/control_panel.png")
コード例 #2
0
def write_offset_to_printer_yml():
    add_printer_controller = NewController('desktop.png', ['printer_local.png'], 'WINDOW')
    add_printer_controller.click_position_tool('add_icon1.png')
    edit_dict = {'add_printer': add_printer_controller.relative_offset}
    add_printer_controller.dump_to_yaml(edit_dict)
    new_printer_controller = NewController('desktop.png', ['new_printer.png'], 'WINDOW')
    new_printer_controller.click_position_tool('HP_Laserjet_P2035.png')
    edit_dict['chose_printer'] = new_printer_controller.relative_offset
    new_printer_controller.click_position_tool('forward.png')
    edit_dict['confirm'] = new_printer_controller.relative_offset
    new_printer_controller.click_position_tool('apply.png')
    edit_dict['prepare_print'] = new_printer_controller.relative_offset
    new_printer_controller.dump_to_yaml(edit_dict)
    print_page_controller = NewController('desktop.png', ['print_page.png'], 'WINDOW')
    print_page_controller.click_position_tool('print_test_page.png')
    edit_dict['print_test_page'] = print_page_controller.relative_offset
    print_page_controller.dump_to_yaml(edit_dict)
    time.sleep(15)
    submit_controller = NewController('desktop.png', ['submited_ok.png'], 'WINDOW')
    submit_controller.click_position_tool('ok_copy.png')
    edit_dict['submit'] = submit_controller.relative_offset
    submit_controller.dump_to_yaml(edit_dict)
    printer_properties_controller = NewController('desktop.png', ['printer_properties.png',
                                                                  'printer_properties_italic.png', 
                                                                  'printer_properties_italic1.png'], 'WINDOW')
    printer_properties_controller.click_position_tool('ok_small.png')
    edit_dict['printer_properties'] = printer_properties_controller.relative_offset
    printer_properties_controller.dump_to_yaml(edit_dict)
    delete_printer_controller = NewController('desktop.png', ['printer_local.png'], 'WINDOW')
    delete_printer_controller.click_position_tool('printer.png')
    delete_printer_controller.rightclick_position_tool('printer.png')
    edit_dict['delete_printer'] = delete_printer_controller.relative_offset
    delete_printer_controller.dump_to_yaml(edit_dict)
    confirm_deletion_controller = NewController('desktop.png', ['confirm.png'], 'WINDOW')
    confirm_deletion_controller.click_position_tool('delete.png')
    edit_dict['confirm_deletion'] = confirm_deletion_controller.relative_offset
    confirm_deletion_controller.dump_to_yaml(edit_dict)
    cancel_usbupdate_contrller = NewController('desktop.png', ['USB_update.png'], 'WINDOW')
    cancel_usbupdate_contrller.click_position_tool('usb_cancel.png')
    edit_dict['USB_Update'] = cancel_usbupdate_contrller.relative_offset
    cancel_usbupdate_contrller.dump_to_yaml(edit_dict)
コード例 #3
0
def write_rdp_offset_to_yml():
    # remove_rdp()
    # create_rdp()
    rdp_icon = NewController('desktop_root.png', ['rdp_icon.png'], 'ICON')
    rdp_icon.rightclick_position('')
    pyautogui.press(['down', 'down'])
    pyautogui.press('enter')

    rdp_connnection_table_controller = NewController(
        'desktop_connection.png', ['rdp_title.png', 'rdp_title_italic.png'],
        'WINDOW', 'rdp_config.yml')
    edit_dict = {}
    # rdp_connnection_table_controller.click_position_tool('connection_table_current_mode.png')
    # edit_dict = {'connection_table_current_mode': rdp_connnection_table_controller.relative_offset}
    # pyautogui.press(['down', 'enter'])
    rdp_connnection_table_controller.click_position_tool(
        'rdp_table_url.png', (0.9, 0.5))
    edit_dict[
        'rdp_table_url'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.click_position_tool(
        'rdp_table_use_predefined.png')
    edit_dict[
        'rdp_table_use_predefined'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.click_position_tool(
        'rdp_table_user.png', (0.9, 0.5))
    edit_dict[
        'rdp_table_user'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.click_position_tool(
        'rdp_table_password.png', (0.9, .5))
    edit_dict[
        'rdp_table_password'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.click_position_tool(
        'rdp_table_domain.png', (0.9, 0.5))
    edit_dict[
        'rdp_table_domain'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.click_position_tool(
        'rdp_local_resource.png')
    edit_dict[
        'rdp_local_resource'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.click_position_tool('rdp_high_level.png')
    edit_dict[
        'rdp_high_level'] = rdp_connnection_table_controller.relative_offset
    # rdp_connnection_table_controller.click_position_tool(root, 'ok.png')
    # edit_dict['ok'] = rdp_connnection_table_controller.relative_offset
    rdp_connnection_table_controller.dump_to_yaml(edit_dict)