Skip to content

Commit 56abe02

Browse files
authored
Merge pull request #29 from JE-Chen/dev
update doc
2 parents 1118c52 + 135cb29 commit 56abe02

File tree

7 files changed

+53
-5
lines changed

7 files changed

+53
-5
lines changed

.idea/workspace.xml

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

docs/source/doc/auto_control_executor_doc/auto_control_executor_doc.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ AutoControlGUI Executor Doc
4040
:param json_save_path json save path
4141
:param action_json the json str include action to write
4242
"""
43+
44+
.. code-block:: python
45+
46+
def execute_files(execute_files_list: list):
47+
"""
48+
:param execute_files_list: list include execute files path
49+
:return: every execute detail as list
50+
"""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
AutoControlGUI File Process Doc
2+
==========================
3+
4+
5+
.. code-block:: python
6+
7+
def get_dir_files_as_list(dir_path: str = getcwd(), default_search_file_extension: str = ".json"):
8+
"""
9+
get dir file when end with default_search_file_extension
10+
:param dir_path: which dir we want to walk and get file list
11+
:param default_search_file_extension: which extension we want to search
12+
:return: [] if nothing searched or [file1, file2.... files] file was searched
13+
"""
14+
return [
15+
abspath(join(dir_path, file)) for root, dirs, files in walk(dir_path)
16+
for file in files
17+
if file.endswith(default_search_file_extension.lower())
18+
]

docs/source/doc/doc_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Doc
1414
auto_control_screen_doc/auto_control_screen_doc.rst
1515
auto_control_test_record_doc/auto_control_test_record_doc.rst
1616
generate_html_doc/generate_html_doc.rst
17+
auto_control_file_process_doc/auto_control_file_process_doc.rst

docs/source/example/executor_example/execute_action.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,17 @@ AutoControlGUI Execute action
7373
execute_action(test_list)
7474
7575
76+
.. code-block:: python
77+
78+
"""
79+
get current dir all execute file(json file) list and execute list of file
80+
"""
81+
import os
7682
83+
from je_auto_control import get_dir_files_as_list
84+
from je_auto_control import execute_files
85+
files_list = get_dir_files_as_list(os.getcwd())
86+
print(files_list)
87+
if files_list is not None:
88+
execute_files(files_list)
7789

je_auto_control/utils/executor/action_executor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ def execute_action(action_list: list):
9191

9292
def execute_files(execute_files_list: list):
9393
"""
94-
:param execute_files_list:
95-
:return:
94+
:param execute_files_list: list include execute files path
95+
:return: every execute detail as list
9696
"""
97+
execute_detail_list = list()
9798
for file in execute_files_list:
98-
execute_action(read_action_json(file))
99+
execute_detail_list.append(execute_action(read_action_json(file)))
100+
return execute_detail_list

je_auto_control/utils/file_process/get_dir_file_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
def get_dir_files_as_list(dir_path: str = getcwd(), default_search_file_extension: str = ".json"):
88
"""
9+
get dir file when end with default_search_file_extension
910
:param dir_path: which dir we want to walk and get file list
1011
:param default_search_file_extension: which extension we want to search
1112
:return: [] if nothing searched or [file1, file2.... files] file was searched

0 commit comments

Comments
 (0)