From 0d276a876398f2d78238891e4243cf61be9830cd Mon Sep 17 00:00:00 2001 From: JE-Chen <33644111+JE-Chen@users.noreply.github.com> Date: Mon, 14 Nov 2022 19:56:35 +0800 Subject: [PATCH] refactor refactor --- .../auto-control-github-actions_dev.yml | 118 +++---- .../auto-control-github-actions_stable.yml | 118 +++---- .idea/workspace.xml | 52 ++- README.md | 10 +- dev_setup.py | 2 - docs/.readthedocs.yaml | 10 +- docs/source/conf.py | 6 +- je_auto_control/__init__.py | 103 +++--- je_auto_control/__main__.py | 7 +- .../linux_with_x11/core/utils/__init__.py | 1 - .../core/utils/x11_linux_display.py | 2 +- .../linux_with_x11/core/utils/x11_linux_vk.py | 3 +- .../keyboard/x11_linux_keyboard_control.py | 2 +- .../listener/x11_linux_listener.py | 4 +- .../mouse/x11_linux_mouse_control.py | 2 +- .../linux_with_x11/record/x11_linux_record.py | 7 +- .../linux_with_x11/screen/x11_linux_screen.py | 2 +- je_auto_control/osx/core/utils/__init__.py | 1 - je_auto_control/osx/core/utils/osx_vk.py | 1 - je_auto_control/osx/keyboard/osx_keyboard.py | 1 - .../osx/keyboard/osx_keyboard_check.py | 1 - je_auto_control/osx/listener/osx_listener.py | 4 - je_auto_control/osx/mouse/osx_mouse.py | 2 +- je_auto_control/utils/exception/exceptions.py | 2 - .../utils/executor/action_executor.py | 6 +- .../utils/file_process/get_dir_file_list.py | 2 +- .../utils/html_report/html_report_generate.py | 6 +- je_auto_control/utils/json/json_file.py | 5 +- .../auto_control_socket_server.py | 1 - .../utils/timeout/multiprocess_timeout.py | 3 +- .../windows/core/utils/__init__.py | 2 +- .../windows/core/utils/win32_ctype_input.py | 1 - .../windows/core/utils/win32_vk.py | 2 +- .../windows/listener/win32_mouse_listener.py | 4 - .../windows/record/win32_record.py | 1 - je_auto_control/wrapper/auto_control_image.py | 6 +- .../wrapper/auto_control_keyboard.py | 2 +- je_auto_control/wrapper/auto_control_mouse.py | 6 +- .../wrapper/auto_control_record.py | 3 +- .../wrapper/auto_control_screen.py | 4 +- je_auto_control/wrapper/platform_wrapper.py | 10 +- test/gui_test/calculator/calculator.py | 3 +- test/gui_test/image/locate_all_image.py | 5 +- test/gui_test/image/locate_and_click.py | 3 +- test/gui_test/image/locate_image_center.py | 3 +- .../get_dir_file_and_execute.py | 3 +- .../get_dir_file_and_execute/test1.json | 36 +- .../get_dir_file_and_execute/test2.json | 36 +- .../get_dir_file_and_execute/test3.json | 36 +- .../test.html | 319 +++++++++--------- .../total_record_and_html_report_test.py | 4 +- test/unit_test/argparse/test1.json | 36 +- test/unit_test/argparse/test2.json | 36 +- .../critical_exit/critical_exit_test.py | 18 +- .../critical_exit/real_critical_test.py | 9 +- test/unit_test/execute_action/test.json | 36 +- test/unit_test/html_report/test.json | 36 +- test/unit_test/json/json_test.py | 2 +- .../keyboard/keyboard_is_press_test.py | 2 +- test/unit_test/keyboard/keyboard_type_test.py | 5 +- test/unit_test/mouse/mouse_test.py | 8 +- test/unit_test/record/record_test.py | 2 +- test/unit_test/screen/screen_test.py | 1 + .../socket_server_test/socket_client_test.py | 1 - .../total_record/total_record_test.py | 5 +- 65 files changed, 698 insertions(+), 472 deletions(-) diff --git a/.github/workflows/auto-control-github-actions_dev.yml b/.github/workflows/auto-control-github-actions_dev.yml index 148440d..30cedbc 100644 --- a/.github/workflows/auto-control-github-actions_dev.yml +++ b/.github/workflows/auto-control-github-actions_dev.yml @@ -14,62 +14,62 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.7 - uses: actions/setup-python@v3 - with: - python-version: "3.7" - - name: Install dependencies - run: | - python -m pip install --upgrade pip wheel - pip install -r dev_requirements.txt - # screen test - - name: screen_test - run: python ./test/unit_test/screen/screen_test.py - - name: screenshot_test - run: python ./test/unit_test/screen/screenshot_test.py - # keyboard test - - name: keyboard_type_test - run: python ./test/unit_test/keyboard/keyboard_type_test.py - - name: keyboard_write_test - run: | - python ./test/unit_test/keyboard/keyboard_write_test.py - - name: keyboard_is_press_test - run: python ./test/unit_test/keyboard/keyboard_is_press_test.py - - name: hotkey_test - run: python ./test/unit_test/keyboard/hotkey_test.py - # mouse test - - name: mouse_test - run: python ./test/unit_test/mouse/mouse_test.py - - name: scroll_test - run: python ./test/unit_test/exception/auto_control_exception_test.py - # exception test - - name: auto_control_exception_test - run: python ./test/unit_test/exception/auto_control_exception_test.py - # critical exit - - name: critical_exit_test - run: python ./test/unit_test/critical_exit/critical_exit_test.py - - name: real_critical_test - run: | - python ./test/unit_test/critical_exit/real_critical_test.py - exit 0 - # test_record - - name: record_test - run: python ./test/unit_test/record/record_test.py - - name: total record - run: python ./test/unit_test/total_record/total_record_test.py - # execute - - name: execute_action_test - run: python ./test/unit_test/execute_action/execute_action_test.py - # json - - name: json_test - run: python ./test/unit_test/json/json_test.py - # timeout - - name: timeout_test - run: python ./test/unit_test/timeout/timeout_test.py - # argparse - - name: argparse_test - run: python ./test/unit_test/argparse/argparse_test.py - # html report test - - name: html_report_test - run: python ./test/unit_test/html_report/html_report_test.py \ No newline at end of file + - uses: actions/checkout@v3 + - name: Set up Python 3.7 + uses: actions/setup-python@v3 + with: + python-version: "3.7" + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install -r dev_requirements.txt + # screen test + - name: screen_test + run: python ./test/unit_test/screen/screen_test.py + - name: screenshot_test + run: python ./test/unit_test/screen/screenshot_test.py + # keyboard test + - name: keyboard_type_test + run: python ./test/unit_test/keyboard/keyboard_type_test.py + - name: keyboard_write_test + run: | + python ./test/unit_test/keyboard/keyboard_write_test.py + - name: keyboard_is_press_test + run: python ./test/unit_test/keyboard/keyboard_is_press_test.py + - name: hotkey_test + run: python ./test/unit_test/keyboard/hotkey_test.py + # mouse test + - name: mouse_test + run: python ./test/unit_test/mouse/mouse_test.py + - name: scroll_test + run: python ./test/unit_test/exception/auto_control_exception_test.py + # exception test + - name: auto_control_exception_test + run: python ./test/unit_test/exception/auto_control_exception_test.py + # critical exit + - name: critical_exit_test + run: python ./test/unit_test/critical_exit/critical_exit_test.py + - name: real_critical_test + run: | + python ./test/unit_test/critical_exit/real_critical_test.py + exit 0 + # test_record + - name: record_test + run: python ./test/unit_test/record/record_test.py + - name: total record + run: python ./test/unit_test/total_record/total_record_test.py + # execute + - name: execute_action_test + run: python ./test/unit_test/execute_action/execute_action_test.py + # json + - name: json_test + run: python ./test/unit_test/json/json_test.py + # timeout + - name: timeout_test + run: python ./test/unit_test/timeout/timeout_test.py + # argparse + - name: argparse_test + run: python ./test/unit_test/argparse/argparse_test.py + # html report test + - name: html_report_test + run: python ./test/unit_test/html_report/html_report_test.py \ No newline at end of file diff --git a/.github/workflows/auto-control-github-actions_stable.yml b/.github/workflows/auto-control-github-actions_stable.yml index f4b42bd..2664e51 100644 --- a/.github/workflows/auto-control-github-actions_stable.yml +++ b/.github/workflows/auto-control-github-actions_stable.yml @@ -14,62 +14,62 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.5 - uses: actions/setup-python@v3 - with: - python-version: "3.7" - - name: Install dependencies - run: | - python -m pip install --upgrade pip wheel - pip install -r requirements.txt - # screen test - - name: screen_test - run: python ./test/unit_test/screen/screen_test.py - - name: screenshot_test - run: python ./test/unit_test/screen/screenshot_test.py - # keyboard test - - name: keyboard_type_test - run: python ./test/unit_test/keyboard/keyboard_type_test.py - - name: keyboard_write_test - run: | - python ./test/unit_test/keyboard/keyboard_write_test.py - - name: keyboard_is_press_test - run: python ./test/unit_test/keyboard/keyboard_is_press_test.py - - name: hotkey_test - run: python ./test/unit_test/keyboard/hotkey_test.py - # mouse test - - name: mouse_test - run: python ./test/unit_test/mouse/mouse_test.py - - name: scroll_test - run: python ./test/unit_test/exception/auto_control_exception_test.py - # exception test - - name: auto_control_exception_test - run: python ./test/unit_test/exception/auto_control_exception_test.py - # critical exit - - name: critical_exit_test - run: python ./test/unit_test/critical_exit/critical_exit_test.py - - name: real_critical_test - run: | - python ./test/unit_test/critical_exit/real_critical_test.py - exit 0 - # test_record - - name: record_test - run: python ./test/unit_test/record/record_test.py - - name: total record - run: python ./test/unit_test/total_record/total_record_test.py - # execute - - name: execute_action_test - run: python ./test/unit_test/execute_action/execute_action_test.py - # json - - name: json_test - run: python ./test/unit_test/json/json_test.py - # timeout - - name: timeout_test - run: python ./test/unit_test/timeout/timeout_test.py - # argparse - - name: argparse_test - run: python ./test/unit_test/argparse/argparse_test.py - # html report test - - name: html_report_test - run: python ./test/unit_test/html_report/html_report_test.py \ No newline at end of file + - uses: actions/checkout@v3 + - name: Set up Python 3.5 + uses: actions/setup-python@v3 + with: + python-version: "3.7" + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install -r requirements.txt + # screen test + - name: screen_test + run: python ./test/unit_test/screen/screen_test.py + - name: screenshot_test + run: python ./test/unit_test/screen/screenshot_test.py + # keyboard test + - name: keyboard_type_test + run: python ./test/unit_test/keyboard/keyboard_type_test.py + - name: keyboard_write_test + run: | + python ./test/unit_test/keyboard/keyboard_write_test.py + - name: keyboard_is_press_test + run: python ./test/unit_test/keyboard/keyboard_is_press_test.py + - name: hotkey_test + run: python ./test/unit_test/keyboard/hotkey_test.py + # mouse test + - name: mouse_test + run: python ./test/unit_test/mouse/mouse_test.py + - name: scroll_test + run: python ./test/unit_test/exception/auto_control_exception_test.py + # exception test + - name: auto_control_exception_test + run: python ./test/unit_test/exception/auto_control_exception_test.py + # critical exit + - name: critical_exit_test + run: python ./test/unit_test/critical_exit/critical_exit_test.py + - name: real_critical_test + run: | + python ./test/unit_test/critical_exit/real_critical_test.py + exit 0 + # test_record + - name: record_test + run: python ./test/unit_test/record/record_test.py + - name: total record + run: python ./test/unit_test/total_record/total_record_test.py + # execute + - name: execute_action_test + run: python ./test/unit_test/execute_action/execute_action_test.py + # json + - name: json_test + run: python ./test/unit_test/json/json_test.py + # timeout + - name: timeout_test + run: python ./test/unit_test/timeout/timeout_test.py + # argparse + - name: argparse_test + run: python ./test/unit_test/argparse/argparse_test.py + # html report test + - name: html_report_test + run: python ./test/unit_test/html_report/html_report_test.py \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 37a89aa..74f3254 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,43 +2,69 @@ + + - - + + + + + + + + + - - - + + + + + - - - + - - + + + + + + + + + + + + + + + - - + + + - + + + +