Skip to content
Merged

Dev #85

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
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

44 changes: 20 additions & 24 deletions .idea/workspace.xml

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

23 changes: 23 additions & 0 deletions docs/source/Eng/doc/create_project/create_project_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Create Project
----

In AutoControl, you can create a project which will automatically generate sample files once the project is created.
These sample files include a Python executor file and a keyword.json file.

To create a project, you can use the following method:

.. code-block:: python

from je_auto_control import create_project_dir
# create on current workdir
create_project_dir()
# create project on project_path
create_project_dir("project_path")
# create project on project_path and dir name is My First Project
create_project_dir("project_path", "My First Project")

Or using CLI, this will generate a project at the project_path location.

.. code-block:: console

python -m je_auto_control --create_project project_path
1 change: 1 addition & 0 deletions docs/source/Eng/eng_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AutoControl English Documentation
:maxdepth: 4

doc/installation/installation_doc.rst
doc/create_project/create_project_doc.rst
doc/keyboard/keyboard_doc.rst
doc/mouse/mouse_doc.rst
doc/screen/screen_doc.rst
Expand Down
23 changes: 23 additions & 0 deletions docs/source/Zh/doc/create_project/create_project_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
創建專案
----

在 AutoControl 裡可以創建專案,創建專案後將會自動生成範例文件,
範例文件包含 python executor 檔案以及 keyword.json 檔案。

要創建專案可以用以下方式:

.. code-block:: python

from je_auto_control import create_project_dir
# create on current workdir
create_project_dir()
# create project on project_path
create_project_dir("project_path")
# create project on project_path and dir name is My First Project
create_project_dir("project_path", "My First Project")

或是這個方式將會在 project_path 路徑產生專案

.. code-block:: console

python -m je_auto_control --create_project project_path
1 change: 1 addition & 0 deletions docs/source/Zh/zh_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AutoControl 繁體中文 文件
:maxdepth: 4

doc/installation/installation_doc.rst
doc/create_project/create_project_doc.rst
doc/keyboard/keyboard_doc.rst
doc/mouse/mouse_doc.rst
doc/screen/screen_doc.rst
Expand Down
5 changes: 4 additions & 1 deletion je_auto_control/utils/callback/callback_function_executor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import typing
from sys import stderr

from je_auto_control.utils.project.create_project_structure import create_project_dir
from je_auto_control.utils.exception.exception_tags import get_bad_trigger_method, get_bad_trigger_function
from je_auto_control.utils.exception.exceptions import CallbackExecutorException
# executor
Expand Down Expand Up @@ -108,7 +109,9 @@ def __init__(self):
"write_action_json": write_action_json,
"start_autocontrol_socket_server": start_autocontrol_socket_server,
"add_package_to_executor": package_manager.add_package_to_executor,
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor,
# project
"create_project": create_project_dir
}

def callback_function(
Expand Down
5 changes: 4 additions & 1 deletion je_auto_control/utils/executor/action_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import builtins
from inspect import getmembers, isbuiltin

from je_auto_control.utils.project.create_project_structure import create_project_dir
from je_auto_control.utils.exception.exception_tags import action_is_null_error, add_command_exception_tag, \
executor_list_error
from je_auto_control.utils.exception.exception_tags import cant_execute_action_error
Expand Down Expand Up @@ -79,7 +80,9 @@ def __init__(self):
"execute_action": self.execute_action,
"execute_files": self.execute_files,
"add_package_to_executor": package_manager.add_package_to_executor,
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor,
# project
"create_project": create_project_dir
}
# get all builtin function and add to event dict
for function in getmembers(builtins, isbuiltin):
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Rename to build stable version
# This is stable version
# Rename to build dev version
# This is dev version
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "je_auto_control"
version = "0.0.133"
name = "je_auto_control_dev"
version = "0.0.70"
authors = [
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
]
Expand Down
10 changes: 5 additions & 5 deletions dev.toml → stable.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Rename to build dev version
# This is dev version
# Rename to build stable version
# This is stable version
[build-system]
requires = ["setuptools"]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "je_auto_control_dev"
version = "0.0.68"
name = "je_auto_control"
version = "0.0.134"
authors = [
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
]
Expand Down