Skip to content
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
10 changes: 8 additions & 2 deletions .idea/workspace.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ AutoControlGUI Executor Doc
:param json_save_path json save path
:param action_json the json str include action to write
"""

.. code-block:: python

def execute_files(execute_files_list: list):
"""
:param execute_files_list: list include execute files path
:return: every execute detail as list
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
AutoControlGUI File Process Doc
==========================


.. code-block:: python

def get_dir_files_as_list(dir_path: str = getcwd(), default_search_file_extension: str = ".json"):
"""
get dir file when end with default_search_file_extension
:param dir_path: which dir we want to walk and get file list
:param default_search_file_extension: which extension we want to search
:return: [] if nothing searched or [file1, file2.... files] file was searched
"""
return [
abspath(join(dir_path, file)) for root, dirs, files in walk(dir_path)
for file in files
if file.endswith(default_search_file_extension.lower())
]
1 change: 1 addition & 0 deletions docs/source/doc/doc_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Doc
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
auto_control_file_process_doc/auto_control_file_process_doc.rst
12 changes: 12 additions & 0 deletions docs/source/example/executor_example/execute_action.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,17 @@ AutoControlGUI Execute action
execute_action(test_list)


.. code-block:: python

"""
get current dir all execute file(json file) list and execute list of file
"""
import os

from je_auto_control import get_dir_files_as_list
from je_auto_control import execute_files
files_list = get_dir_files_as_list(os.getcwd())
print(files_list)
if files_list is not None:
execute_files(files_list)

8 changes: 5 additions & 3 deletions je_auto_control/utils/executor/action_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ def execute_action(action_list: list):

def execute_files(execute_files_list: list):
"""
:param execute_files_list:
:return:
:param execute_files_list: list include execute files path
:return: every execute detail as list
"""
execute_detail_list = list()
for file in execute_files_list:
execute_action(read_action_json(file))
execute_detail_list.append(execute_action(read_action_json(file)))
return execute_detail_list
1 change: 1 addition & 0 deletions je_auto_control/utils/file_process/get_dir_file_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

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