Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update doc #25

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/source/doc/doc_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Doc
auto_control_record_doc/auto_control_record_doc.rst
auto_control_screen_doc/auto_control_screen_doc.rst
auto_control_test_record_doc/auto_control_test_record_doc.rst
generate_html_doc/generate_html_doc.rst
16 changes: 16 additions & 0 deletions docs/source/doc/generate_html_doc/generate_html_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
==========================
AutoControlGUI Generate Html Report Doc
==========================


.. code-block:: python

def generate_html(html_name: str = "default_name"):
"""
this function will create and save html report on current folder
:param html_name: save html file name
:return: html_string
"""



3 changes: 2 additions & 1 deletion docs/source/example/example_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Example
image_detect_example/image_detect.rst
record_example/record.rst
executor_example/execute_action.rst
editor_example/editor.rst
editor_example/editor.rst
generate_html_example/generate_html_example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
========================
AutoControlGUI Generate Html Example
========================

.. code-block:: python

import sys

from je_auto_control import test_record
from je_auto_control import press_key
from je_auto_control import release_key
from je_auto_control import write
from je_auto_control import keys_table
from je_auto_control import generate_html

# init test_record to record test detail
test_record.init_total_record = True

print(keys_table.keys())
# do something
press_key("shift")
write("123456789")
press_key("return")
release_key("return")
assert (write("abcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyz")
release_key("shift")
press_key("return")
release_key("return")
assert (write("abcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyz")
press_key("return")
release_key("return")

# this write will print one error -> keyboard write error can't find key : ? and write remain string
try:
assert (write("?123456789") == "123456789")
except Exception as error:
print(repr(error), file=sys.stderr)
# this write will print one error -> keyboard write error can't find key : ! and write remain string
try:
write("!#@L@#{@#PL#{!@#L{!#{|##PO}!@#O@!O#P!)KI#O_!K")
except Exception as error:
print(repr(error), file=sys.stderr)

print(test_record.total_record_list)
# html name is test.html and this html will recode all test detail
# if test_record.init_total_record = True
generate_html("test")
1 change: 1 addition & 0 deletions je_auto_control/utils/html_report/html_report_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def make_html_table(event_str: str, record_data: dict, table_head: str):

def generate_html(html_name: str = "default_name"):
"""
this function will create and save html report on current folder
:param html_name: save html file name
:return: html_string
"""
Expand Down
2 changes: 1 addition & 1 deletion je_auto_control/wrapper/auto_control_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def screenshot(file_path: str = None, region: list = None):
record_total("screenshot", param)
return cv2.cvtColor(np.array(pil_screenshot(file_path=file_path, region=region)), cv2.COLOR_RGB2BGR)
except AutoControlScreenException as error:
raise AutoControlScreenException(screen_screenshot + repr(error))
raise AutoControlScreenException(screen_screenshot + " " + repr(error))
except Exception as error:
record_total("screenshot", None, repr(error))
print(repr(error), file=sys.stderr)
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@
)

# python setup.py sdist bdist_wheel
# python -m twine upload dist/*
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@

generate_html("test")