Skip to content

Commit e9d7e27

Browse files
committed
update doc
update doc
1 parent d59a2ba commit e9d7e27

File tree

9 files changed

+79
-8
lines changed

9 files changed

+79
-8
lines changed

.idea/workspace.xml

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/doc/doc_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Doc
1313
auto_control_record_doc/auto_control_record_doc.rst
1414
auto_control_screen_doc/auto_control_screen_doc.rst
1515
auto_control_test_record_doc/auto_control_test_record_doc.rst
16+
generate_html_doc/generate_html_doc.rst
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
==========================
2+
AutoControlGUI Generate Html Report Doc
3+
==========================
4+
5+
6+
.. code-block:: python
7+
8+
def generate_html(html_name: str = "default_name"):
9+
"""
10+
this function will create and save html report on current folder
11+
:param html_name: save html file name
12+
:return: html_string
13+
"""
14+
15+
16+

docs/source/example/example_index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Example
1313
image_detect_example/image_detect.rst
1414
record_example/record.rst
1515
executor_example/execute_action.rst
16-
editor_example/editor.rst
16+
editor_example/editor.rst
17+
generate_html_example/generate_html_example.rst
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
========================
2+
AutoControlGUI Generate Html Example
3+
========================
4+
5+
.. code-block:: python
6+
7+
import sys
8+
9+
from je_auto_control import test_record
10+
from je_auto_control import press_key
11+
from je_auto_control import release_key
12+
from je_auto_control import write
13+
from je_auto_control import keys_table
14+
from je_auto_control import generate_html
15+
16+
# init test_record to record test detail
17+
test_record.init_total_record = True
18+
19+
print(keys_table.keys())
20+
# do something
21+
press_key("shift")
22+
write("123456789")
23+
press_key("return")
24+
release_key("return")
25+
assert (write("abcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyz")
26+
release_key("shift")
27+
press_key("return")
28+
release_key("return")
29+
assert (write("abcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyz")
30+
press_key("return")
31+
release_key("return")
32+
33+
# this write will print one error -> keyboard write error can't find key : ? and write remain string
34+
try:
35+
assert (write("?123456789") == "123456789")
36+
except Exception as error:
37+
print(repr(error), file=sys.stderr)
38+
# this write will print one error -> keyboard write error can't find key : ! and write remain string
39+
try:
40+
write("!#@L@#{@#PL#{!@#L{!#{|##PO}!@#O@!O#P!)KI#O_!K")
41+
except Exception as error:
42+
print(repr(error), file=sys.stderr)
43+
44+
print(test_record.total_record_list)
45+
# html name is test.html and this html will recode all test detail
46+
# if test_record.init_total_record = True
47+
generate_html("test")

je_auto_control/utils/html_report/html_report_generate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def make_html_table(event_str: str, record_data: dict, table_head: str):
130130

131131
def generate_html(html_name: str = "default_name"):
132132
"""
133+
this function will create and save html report on current folder
133134
:param html_name: save html file name
134135
:return: html_string
135136
"""

je_auto_control/wrapper/auto_control_screen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def screenshot(file_path: str = None, region: list = None):
3838
record_total("screenshot", param)
3939
return cv2.cvtColor(np.array(pil_screenshot(file_path=file_path, region=region)), cv2.COLOR_RGB2BGR)
4040
except AutoControlScreenException as error:
41-
raise AutoControlScreenException(screen_screenshot + repr(error))
41+
raise AutoControlScreenException(screen_screenshot + " " + repr(error))
4242
except Exception as error:
4343
record_total("screenshot", None, repr(error))
4444
print(repr(error), file=sys.stderr)

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@
3333
)
3434

3535
# python setup.py sdist bdist_wheel
36-
# python -m twine upload dist/*

test/integrated_test/total_record_and_html_report_test/total_record_and_html_report_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@
3838

3939
generate_html("test")
4040

41-

0 commit comments

Comments
 (0)