Skip to content

Commit 0b3335d

Browse files
authored
Merge pull request #85 from Integrated-Testing-Environment/dev
Dev
2 parents b612774 + 6cd4d18 commit 0b3335d

File tree

10 files changed

+87
-37
lines changed

10 files changed

+87
-37
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 20 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Create Project
2+
----
3+
4+
In AutoControl, you can create a project which will automatically generate sample files once the project is created.
5+
These sample files include a Python executor file and a keyword.json file.
6+
7+
To create a project, you can use the following method:
8+
9+
.. code-block:: python
10+
11+
from je_auto_control import create_project_dir
12+
# create on current workdir
13+
create_project_dir()
14+
# create project on project_path
15+
create_project_dir("project_path")
16+
# create project on project_path and dir name is My First Project
17+
create_project_dir("project_path", "My First Project")
18+
19+
Or using CLI, this will generate a project at the project_path location.
20+
21+
.. code-block:: console
22+
23+
python -m je_auto_control --create_project project_path

docs/source/Eng/eng_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ AutoControl English Documentation
66
:maxdepth: 4
77

88
doc/installation/installation_doc.rst
9+
doc/create_project/create_project_doc.rst
910
doc/keyboard/keyboard_doc.rst
1011
doc/mouse/mouse_doc.rst
1112
doc/screen/screen_doc.rst
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
創建專案
2+
----
3+
4+
在 AutoControl 裡可以創建專案,創建專案後將會自動生成範例文件,
5+
範例文件包含 python executor 檔案以及 keyword.json 檔案。
6+
7+
要創建專案可以用以下方式:
8+
9+
.. code-block:: python
10+
11+
from je_auto_control import create_project_dir
12+
# create on current workdir
13+
create_project_dir()
14+
# create project on project_path
15+
create_project_dir("project_path")
16+
# create project on project_path and dir name is My First Project
17+
create_project_dir("project_path", "My First Project")
18+
19+
或是這個方式將會在 project_path 路徑產生專案
20+
21+
.. code-block:: console
22+
23+
python -m je_auto_control --create_project project_path

docs/source/Zh/zh_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ AutoControl 繁體中文 文件
66
:maxdepth: 4
77

88
doc/installation/installation_doc.rst
9+
doc/create_project/create_project_doc.rst
910
doc/keyboard/keyboard_doc.rst
1011
doc/mouse/mouse_doc.rst
1112
doc/screen/screen_doc.rst

je_auto_control/utils/callback/callback_function_executor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import typing
22
from sys import stderr
33

4+
from je_auto_control.utils.project.create_project_structure import create_project_dir
45
from je_auto_control.utils.exception.exception_tags import get_bad_trigger_method, get_bad_trigger_function
56
from je_auto_control.utils.exception.exceptions import CallbackExecutorException
67
# executor
@@ -108,7 +109,9 @@ def __init__(self):
108109
"write_action_json": write_action_json,
109110
"start_autocontrol_socket_server": start_autocontrol_socket_server,
110111
"add_package_to_executor": package_manager.add_package_to_executor,
111-
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor
112+
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor,
113+
# project
114+
"create_project": create_project_dir
112115
}
113116

114117
def callback_function(

je_auto_control/utils/executor/action_executor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import builtins
55
from inspect import getmembers, isbuiltin
66

7+
from je_auto_control.utils.project.create_project_structure import create_project_dir
78
from je_auto_control.utils.exception.exception_tags import action_is_null_error, add_command_exception_tag, \
89
executor_list_error
910
from je_auto_control.utils.exception.exception_tags import cant_execute_action_error
@@ -79,7 +80,9 @@ def __init__(self):
7980
"execute_action": self.execute_action,
8081
"execute_files": self.execute_files,
8182
"add_package_to_executor": package_manager.add_package_to_executor,
82-
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor
83+
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor,
84+
# project
85+
"create_project": create_project_dir
8386
}
8487
# get all builtin function and add to event dict
8588
for function in getmembers(builtins, isbuiltin):

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Rename to build stable version
2-
# This is stable version
1+
# Rename to build dev version
2+
# This is dev version
33
[build-system]
4-
requires = ["setuptools>=61.0"]
4+
requires = ["setuptools"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
8-
name = "je_auto_control"
9-
version = "0.0.133"
8+
name = "je_auto_control_dev"
9+
version = "0.0.70"
1010
authors = [
1111
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
1212
]

dev.toml renamed to stable.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Rename to build dev version
2-
# This is dev version
1+
# Rename to build stable version
2+
# This is stable version
33
[build-system]
4-
requires = ["setuptools"]
4+
requires = ["setuptools>=61.0"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
8-
name = "je_auto_control_dev"
9-
version = "0.0.68"
8+
name = "je_auto_control"
9+
version = "0.0.134"
1010
authors = [
1111
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
1212
]

0 commit comments

Comments
 (0)