From 1170b0a00e0b707b43363280ef7dbb63aeebf645 Mon Sep 17 00:00:00 2001
From: JeffreyChen <33644111+JE-Chen@users.noreply.github.com>
Date: Mon, 22 Jul 2024 08:53:02 +0800
Subject: [PATCH 1/7] Refactor
---
.idea/workspace.xml | 37 ++++++++--------
.../generate_autocontrol_driver.py | 11 ++---
je_auto_control/__init__.py | 3 --
.../callback/callback_function_executor.py | 12 +++---
.../utils/cv2_utils/template_detection.py | 14 ++++---
je_auto_control/utils/exception/exceptions.py | 42 +++++++++----------
.../utils/executor/action_executor.py | 10 ++---
.../utils/scheduler/extend_apscheduler.py | 4 +-
.../change_xml_structure.py | 4 +-
pyproject.toml | 4 +-
stable.toml | 2 -
11 files changed, 64 insertions(+), 79 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8081910..6bcb331 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -58,25 +58,25 @@
- {
+ "keyToString": {
+ "DefaultHtmlFileTemplate": "HTML File",
+ "Python.screen_test.executor": "Run",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "WebServerToolWindowFactoryState": "false",
+ "git-widget-placeholder": "dev",
+ "ignore.virus.scanning.warn.message": "true",
+ "last_opened_file_path": "C:/Users/JeffreyChen/Desktop/Code_Space/APITestka",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -516,6 +516,7 @@
+
diff --git a/autocontrol_driver/generate_autocontrol_driver.py b/autocontrol_driver/generate_autocontrol_driver.py
index 753c7d5..6bb8d98 100644
--- a/autocontrol_driver/generate_autocontrol_driver.py
+++ b/autocontrol_driver/generate_autocontrol_driver.py
@@ -2,10 +2,7 @@
from je_auto_control import start_autocontrol_socket_server
-try:
- server = start_autocontrol_socket_server()
- while not server.close_flag:
- pass
- sys.exit(0)
-except Exception as error:
- print(repr(error))
+server = start_autocontrol_socket_server()
+while True:
+ if server.close_flag:
+ sys.exit(0)
diff --git a/je_auto_control/__init__.py b/je_auto_control/__init__.py
index 9cc574e..049366a 100644
--- a/je_auto_control/__init__.py
+++ b/je_auto_control/__init__.py
@@ -104,8 +104,6 @@
# import screen
from je_auto_control.wrapper.auto_control_screen import screen_size
from je_auto_control.wrapper.auto_control_screen import screenshot
-# GUI
-from je_auto_control.gui.main_window import start_autocontrol_gui
__all__ = [
"click_mouse", "mouse_keys_table", "get_mouse_position", "press_mouse", "release_mouse",
"mouse_scroll", "set_mouse_position", "special_mouse_keys_table",
@@ -121,5 +119,4 @@
"generate_html", "generate_html_report", "generate_json", "generate_json_report", "generate_xml",
"generate_xml_report", "get_dir_files_as_list", "create_project_dir", "start_autocontrol_socket_server",
"callback_executor", "package_manager", "get_special_table", "ShellManager", "default_shell_manager",
- "start_autocontrol_gui"
]
diff --git a/je_auto_control/utils/callback/callback_function_executor.py b/je_auto_control/utils/callback/callback_function_executor.py
index 725faba..839ed88 100644
--- a/je_auto_control/utils/callback/callback_function_executor.py
+++ b/je_auto_control/utils/callback/callback_function_executor.py
@@ -128,12 +128,12 @@ def callback_function(
**kwargs
) -> Any:
"""
- :param trigger_function_name: what function we want to trigger only accept function in event_dict
- :param callback_function: what function we want to callback
- :param callback_function_param: callback function's param only accept dict
- :param callback_param_method: what type param will use on callback function only accept kwargs and args
- :param kwargs: trigger_function's param
- :return: trigger_function_name return value
+ :param trigger_function_name: what function we want to trigger only accept function in event_dict.
+ :param callback_function: what function we want to callback.
+ :param callback_function_param: callback function's param only accept dict.
+ :param callback_param_method: what type param will use on callback function only accept kwargs and args.
+ :param kwargs: trigger_function's param.
+ :return: trigger_function_name return value.
"""
try:
if trigger_function_name not in self.event_dict.keys():
diff --git a/je_auto_control/utils/cv2_utils/template_detection.py b/je_auto_control/utils/cv2_utils/template_detection.py
index 94dfd6a..d99934e 100644
--- a/je_auto_control/utils/cv2_utils/template_detection.py
+++ b/je_auto_control/utils/cv2_utils/template_detection.py
@@ -6,9 +6,10 @@
def find_image(image, detect_threshold: float = 1, draw_image: bool = False) -> List[int]:
"""
- :param image which cv2_utils we want to find on screen
- :param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal
- :param draw_image draw detect tag on return cv2_utils
+ Find image with detect threshold on screen.
+ :param image: which cv2_utils we want to find on screen
+ :param detect_threshold: detect precision 0.0 ~ 1.0; 1 is absolute equal
+ :param draw_image: draw detect tag on return cv2_utils
"""
grab_image = ImageGrab.grab()
return template_detection.find_object(image=grab_image, template=image,
@@ -17,9 +18,10 @@ def find_image(image, detect_threshold: float = 1, draw_image: bool = False) ->
def find_image_multi(image, detect_threshold: float = 1, draw_image: bool = False) -> List[List[int]]:
"""
- :param image which cv2_utils we want to find on screen
- :param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal
- :param draw_image draw detect tag on return cv2_utils
+ Find multi image with detect threshold on screen.
+ :param image: which cv2_utils we want to find on screen
+ :param detect_threshold: detect precision 0.0 ~ 1.0; 1 is absolute equal
+ :param draw_image: draw detect tag on return cv2_utils
"""
grab_image = ImageGrab.grab()
return template_detection.find_multi_object(image=grab_image, template=image,
diff --git a/je_auto_control/utils/exception/exceptions.py b/je_auto_control/utils/exception/exceptions.py
index cfeb0cc..30e47cf 100644
--- a/je_auto_control/utils/exception/exceptions.py
+++ b/je_auto_control/utils/exception/exceptions.py
@@ -4,101 +4,97 @@ class AutoControlException(Exception):
# Keyboard
-
-
-class AutoControlKeyboardException(AutoControlException):
+class AutoControlKeyboardException(Exception):
pass
-class AutoControlCantFindKeyException(AutoControlKeyboardException):
+class AutoControlCantFindKeyException(Exception):
pass
# Mouse
-
-
-class AutoControlMouseException(AutoControlException):
+class AutoControlMouseException(Exception):
pass
# Screen
-class AutoControlScreenException(AutoControlException):
+class AutoControlScreenException(Exception):
pass
# Image detect
-class ImageNotFoundException(AutoControlException):
+class ImageNotFoundException(Exception):
pass
# Record
-class AutoControlRecordException(AutoControlException):
+class AutoControlRecordException(Exception):
pass
# Execute action
-class AutoControlExecuteActionException(AutoControlException):
+class AutoControlExecuteActionException(Exception):
pass
-class AutoControlJsonActionException(AutoControlExecuteActionException):
+class AutoControlJsonActionException(Exception):
pass
-class AutoControlActionNullException(AutoControlExecuteActionException):
+class AutoControlActionNullException(Exception):
pass
-class AutoControlActionException(AutoControlExecuteActionException):
+class AutoControlActionException(Exception):
pass
-class AutoControlAddCommandException(AutoControlExecuteActionException):
+class AutoControlAddCommandException(Exception):
pass
-class AutoControlArgparseException(AutoControlExecuteActionException):
+class AutoControlArgparseException(Exception):
pass
# timeout
-class AutoControlTimeoutException(AutoControlException):
+class AutoControlTimeoutException(Exception):
pass
# html exception
-class AutoControlHTMLException(AutoControlException):
+class AutoControlHTMLException(Exception):
pass
# Json Exception
-class AutoControlJsonException(AutoControlException):
+class AutoControlJsonException(Exception):
pass
-class AutoControlGenerateJsonReportException(AutoControlJsonException):
+class AutoControlGenerateJsonReportException(Exception):
pass
# XML
-class XMLException(AutoControlException):
+class XMLException(Exception):
pass
-class XMLTypeException(XMLException):
+class XMLTypeException(Exception):
pass
# Execute callback
-class CallbackExecutorException(AutoControlException):
+class CallbackExecutorException(Exception):
pass
diff --git a/je_auto_control/utils/executor/action_executor.py b/je_auto_control/utils/executor/action_executor.py
index 6a4646f..c7dba6f 100644
--- a/je_auto_control/utils/executor/action_executor.py
+++ b/je_auto_control/utils/executor/action_executor.py
@@ -124,14 +124,12 @@ def execute_action(self, action_list: [list, dict]) -> Dict[str, str]:
"""
auto_control_logger.info(f"execute_action, action_list: {action_list}")
if isinstance(action_list, dict):
- action_list: list = action_list.get("auto_control", None)
+ action_list: list = action_list.get("auto_control")
if action_list is None:
raise AutoControlActionNullException(executor_list_error)
execute_record_dict = dict()
try:
- if len(action_list) > 0 or isinstance(action_list, list):
- pass
- else:
+ if len(action_list) < 0 or isinstance(action_list, list) is False:
raise AutoControlActionNullException(action_is_null_error)
except Exception as error:
record_action_to_list("AC_execute_action", action_list, repr(error))
@@ -167,14 +165,14 @@ def execute_files(self, execute_files_list: list) -> List[Dict[str, str]]:
return execute_detail_list
def scheduler_event_trigger(
- self, function: str, id: str = None, args: Union[list, tuple] = None,
+ self, function: str, scheduler_id: str = None, args: Union[list, tuple] = None,
kwargs: dict = None, scheduler_type: str = "nonblocking", wait_type: str = "secondly",
wait_value: int = 1, **trigger_args: Any) -> None:
if scheduler_type == "nonblocking":
scheduler_event = scheduler_manager.nonblocking_scheduler_event_dict.get(wait_type)
else:
scheduler_event = scheduler_manager.blocking_scheduler_event_dict.get(wait_type)
- scheduler_event(self.event_dict.get(function), id, args, kwargs, wait_value, **trigger_args)
+ scheduler_event(self.event_dict.get(function), scheduler_id, args, kwargs, wait_value, **trigger_args)
executor = Executor()
diff --git a/je_auto_control/utils/scheduler/extend_apscheduler.py b/je_auto_control/utils/scheduler/extend_apscheduler.py
index 7ed0c98..36abd01 100644
--- a/je_auto_control/utils/scheduler/extend_apscheduler.py
+++ b/je_auto_control/utils/scheduler/extend_apscheduler.py
@@ -58,7 +58,7 @@ def add_blocking_job(
"""
params = locals()
params.pop("self")
- trigger_args = params.pop("trigger_args")
+ params.pop("trigger_args")
return self._blocking_schedulers.add_job(**params, **trigger_args)
def add_nonblocking_job(
@@ -92,7 +92,7 @@ def add_nonblocking_job(
"""
params = locals()
params.pop("self")
- trigger_args = params.pop("trigger_args")
+ params.pop("trigger_args")
return self._background_schedulers.add_job(**params, **trigger_args)
def get_blocking_scheduler(self) -> BlockingScheduler:
diff --git a/je_auto_control/utils/xml/change_xml_structure/change_xml_structure.py b/je_auto_control/utils/xml/change_xml_structure/change_xml_structure.py
index 414a8c6..fcb33ab 100644
--- a/je_auto_control/utils/xml/change_xml_structure/change_xml_structure.py
+++ b/je_auto_control/utils/xml/change_xml_structure/change_xml_structure.py
@@ -35,9 +35,7 @@ def dict_to_elements_tree(json_dict: dict):
"""
def _to_elements_tree(json_dict: dict, root):
- if not json_dict:
- pass
- elif isinstance(json_dict, str):
+ if isinstance(json_dict, str):
root.text = json_dict
elif isinstance(json_dict, dict):
for key, value in json_dict.items():
diff --git a/pyproject.toml b/pyproject.toml
index 5e1123e..1f481a6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "je_auto_control_dev"
-version = "0.0.99"
+version = "0.0.100"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -20,8 +20,6 @@ dependencies = [
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
- "Pyside6",
- "qt-material"
]
classifiers = [
"Programming Language :: Python :: 3.9",
diff --git a/stable.toml b/stable.toml
index 97340df..1b46356 100644
--- a/stable.toml
+++ b/stable.toml
@@ -20,8 +20,6 @@ dependencies = [
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
- "Pyside6",
- "qt-material"
]
classifiers = [
"Programming Language :: Python :: 3.9",
From 228359fbfd31a695be8cbd269f7ffe2801b57e47 Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Sat, 31 Aug 2024 21:49:05 +0800
Subject: [PATCH 2/7] Add Pyside6 to dependencies
Add Pyside6 to dependencies
---
.idea/workspace.xml | 18 +++++++++++++-----
je_auto_control/__init__.py | 4 +---
pyproject.toml | 1 +
stable.toml | 1 +
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 6bcb331..f276e29 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,12 @@
-
+
+
+
+
+
+
@@ -67,13 +72,13 @@
"WebServerToolWindowFactoryState": "false",
"git-widget-placeholder": "dev",
"ignore.virus.scanning.warn.message": "true",
- "last_opened_file_path": "C:/Users/JeffreyChen/Desktop/Code_Space/APITestka",
+ "last_opened_file_path": "C:/CodeWorkspace/Python/AutoControlGUI",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
+ "settings.editor.selected.configurable": "io.github.pandier.intellijdiscordrp.settings.DiscordSettingsConfigurable",
"vue.rearranger.settings.migration": "true"
}
}
@@ -222,8 +227,8 @@
-
-
+
+
@@ -517,6 +522,9 @@
+
+
+
diff --git a/je_auto_control/__init__.py b/je_auto_control/__init__.py
index 049366a..15c032d 100644
--- a/je_auto_control/__init__.py
+++ b/je_auto_control/__init__.py
@@ -60,8 +60,6 @@
package_manager
from je_auto_control.utils.project.create_project_structure import \
create_project_dir
-# Scheduler
-from je_auto_control.utils.scheduler.extend_apscheduler import SchedulerManager
# Shell command
from je_auto_control.utils.shell_process.shell_exec import ShellManager
from je_auto_control.utils.shell_process.shell_exec import default_shell_manager
@@ -108,7 +106,7 @@
"click_mouse", "mouse_keys_table", "get_mouse_position", "press_mouse", "release_mouse",
"mouse_scroll", "set_mouse_position", "special_mouse_keys_table",
"keyboard_keys_table", "press_keyboard_key", "release_keyboard_key", "type_keyboard", "check_key_is_press",
- "write", "hotkey", "start_exe", "SchedulerManager", "get_keyboard_keys_table",
+ "write", "hotkey", "start_exe", "get_keyboard_keys_table",
"screen_size", "screenshot", "locate_all_image", "locate_image_center", "locate_and_click",
"CriticalExit", "AutoControlException", "AutoControlKeyboardException",
"AutoControlMouseException", "AutoControlCantFindKeyException",
diff --git a/pyproject.toml b/pyproject.toml
index 1f481a6..ed32195 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,6 +17,7 @@ dependencies = [
"je_open_cv",
"pillow",
"APScheduler",
+ "Pyside6",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
diff --git a/stable.toml b/stable.toml
index 1b46356..09b147b 100644
--- a/stable.toml
+++ b/stable.toml
@@ -16,6 +16,7 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
+ "Pyside6",
"APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
From e0b83a2c243e75f53506883777854558e078407b Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Wed, 4 Dec 2024 04:45:54 +0800
Subject: [PATCH 3/7] Update logger
Update logger
---
.idea/workspace.xml | 100 ++++++++++--------
dev_requirements.txt | 1 +
.../utils/executor/action_executor.py | 10 +-
.../generate_report/generate_html_report.py | 8 +-
.../generate_report/generate_json_report.py | 10 +-
.../generate_report/generate_xml_report.py | 10 +-
.../utils/logging/loggin_instance.py | 30 ++++--
.../package_manager/package_manager_class.py | 6 +-
.../utils/project/create_project_structure.py | 4 +-
.../utils/shell_process/shell_exec.py | 6 +-
.../utils/start_exe/start_another_process.py | 6 +-
.../utils/test_record/record_test_class.py | 4 +-
je_auto_control/wrapper/auto_control_image.py | 30 +++---
.../wrapper/auto_control_keyboard.py | 48 ++++-----
je_auto_control/wrapper/auto_control_mouse.py | 38 +++----
.../wrapper/auto_control_record.py | 10 +-
.../wrapper/auto_control_screen.py | 14 +--
je_auto_control/wrapper/platform_wrapper.py | 8 +-
pyproject.toml | 2 +-
19 files changed, 185 insertions(+), 160 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f276e29..a4daa29 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,9 +6,6 @@
-
-
-
@@ -63,25 +60,30 @@
- {
- "keyToString": {
- "DefaultHtmlFileTemplate": "HTML File",
- "Python.screen_test.executor": "Run",
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "WebServerToolWindowFactoryState": "false",
- "git-widget-placeholder": "dev",
- "ignore.virus.scanning.warn.message": "true",
- "last_opened_file_path": "C:/CodeWorkspace/Python/AutoControlGUI",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "io.github.pandier.intellijdiscordrp.settings.DiscordSettingsConfigurable",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -98,8 +100,8 @@
-
-
+
+
@@ -108,12 +110,12 @@
-
+
-
+
@@ -122,7 +124,7 @@
-
+
@@ -131,12 +133,12 @@
-
+
-
+
@@ -145,7 +147,7 @@
-
+
@@ -154,12 +156,12 @@
-
+
-
+
@@ -168,7 +170,7 @@
-
+
@@ -177,12 +179,12 @@
-
+
-
+
@@ -216,19 +218,19 @@
-
-
-
-
+
+
+
+
-
-
+
+
@@ -524,7 +526,14 @@
-
+
+
+
+
+
+
+
+
@@ -546,10 +555,15 @@
-
+
+
+
+
+
-
+
+
\ No newline at end of file
diff --git a/dev_requirements.txt b/dev_requirements.txt
index f664a94..ce53eec 100644
--- a/dev_requirements.txt
+++ b/dev_requirements.txt
@@ -1,5 +1,6 @@
je_auto_control_dev
wheel
+build
twine
sphinx
sphinx-rtd-theme
diff --git a/je_auto_control/utils/executor/action_executor.py b/je_auto_control/utils/executor/action_executor.py
index c7dba6f..93a50c1 100644
--- a/je_auto_control/utils/executor/action_executor.py
+++ b/je_auto_control/utils/executor/action_executor.py
@@ -15,7 +15,7 @@
from je_auto_control.utils.generate_report.generate_xml_report import generate_xml
from je_auto_control.utils.generate_report.generate_xml_report import generate_xml_report
from je_auto_control.utils.json.json_file import read_action_json
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.package_manager.package_manager_class import package_manager
from je_auto_control.utils.project.create_project_structure import create_project_dir
from je_auto_control.utils.scheduler.extend_apscheduler import scheduler_manager
@@ -122,7 +122,7 @@ def execute_action(self, action_list: [list, dict]) -> Dict[str, str]:
:param action_list the list include action
for loop the list and execute action
"""
- auto_control_logger.info(f"execute_action, action_list: {action_list}")
+ autocontrol_logger.info(f"execute_action, action_list: {action_list}")
if isinstance(action_list, dict):
action_list: list = action_list.get("auto_control")
if action_list is None:
@@ -133,7 +133,7 @@ def execute_action(self, action_list: [list, dict]) -> Dict[str, str]:
raise AutoControlActionNullException(action_is_null_error)
except Exception as error:
record_action_to_list("AC_execute_action", action_list, repr(error))
- auto_control_logger.info(
+ autocontrol_logger.info(
f"execute_action, action_list: {action_list}, "
f"failed: {repr(error)}")
for action in action_list:
@@ -142,7 +142,7 @@ def execute_action(self, action_list: [list, dict]) -> Dict[str, str]:
execute_record = "execute: " + str(action)
execute_record_dict.update({execute_record: event_response})
except Exception as error:
- auto_control_logger.info(
+ autocontrol_logger.info(
f"execute_action, action_list: {action_list}, "
f"action: {action}, failed: {repr(error)}")
record_action_to_list("AC_execute_action", None, repr(error))
@@ -158,7 +158,7 @@ def execute_files(self, execute_files_list: list) -> List[Dict[str, str]]:
:param execute_files_list: list include execute files path
:return: every execute detail as list
"""
- auto_control_logger.info(f"execute_files, execute_files_list: {execute_files_list}")
+ autocontrol_logger.info(f"execute_files, execute_files_list: {execute_files_list}")
execute_detail_list: list = list()
for file in execute_files_list:
execute_detail_list.append(self.execute_action(read_action_json(file)))
diff --git a/je_auto_control/utils/generate_report/generate_html_report.py b/je_auto_control/utils/generate_report/generate_html_report.py
index 00061e6..aef5e10 100644
--- a/je_auto_control/utils/generate_report/generate_html_report.py
+++ b/je_auto_control/utils/generate_report/generate_html_report.py
@@ -2,7 +2,7 @@
from je_auto_control.utils.exception.exception_tags import html_generate_no_data_tag
from je_auto_control.utils.exception.exceptions import AutoControlHTMLException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import test_record_instance
_lock = Lock()
@@ -129,7 +129,7 @@ def make_html_table(event_str: str, record_data: dict, table_head: str) -> str:
def generate_html() -> str:
- auto_control_logger.info("generate_html")
+ autocontrol_logger.info("generate_html")
""" this function will create html string
:return: html_string """
if len(test_record_instance.test_record_list) == 0:
@@ -147,7 +147,7 @@ def generate_html() -> str:
def generate_html_report(html_name: str = "default_name") -> None:
- auto_control_logger.info(f"generate_html_report, html_name: {html_name}")
+ autocontrol_logger.info(f"generate_html_report, html_name: {html_name}")
"""
Output html report file
:param html_name: save html file name
@@ -160,7 +160,7 @@ def generate_html_report(html_name: str = "default_name") -> None:
new_html_string
)
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"generate_html_report, html_name: {html_name}, failed: {repr(error)}")
finally:
_lock.release()
diff --git a/je_auto_control/utils/generate_report/generate_json_report.py b/je_auto_control/utils/generate_report/generate_json_report.py
index 7a7a1bf..94e9b0c 100644
--- a/je_auto_control/utils/generate_report/generate_json_report.py
+++ b/je_auto_control/utils/generate_report/generate_json_report.py
@@ -4,12 +4,12 @@
from je_auto_control.utils.exception.exception_tags import cant_generate_json_report
from je_auto_control.utils.exception.exceptions import AutoControlGenerateJsonReportException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import test_record_instance
def generate_json() -> Tuple[Dict[str, Dict[str, str]], Dict[str, Dict[str, str]]]:
- auto_control_logger.info("generate_json")
+ autocontrol_logger.info("generate_json")
"""
:return: two dict {success_dict}, {failure_dict}
"""
@@ -51,7 +51,7 @@ def generate_json() -> Tuple[Dict[str, Dict[str, str]], Dict[str, Dict[str, str]
def generate_json_report(json_file_name: str = "default_name"):
- auto_control_logger.info(f"generate_json_report, json_file_name: {json_file_name}")
+ autocontrol_logger.info(f"generate_json_report, json_file_name: {json_file_name}")
"""
Output json report file
:param json_file_name: save json file's name
@@ -63,7 +63,7 @@ def generate_json_report(json_file_name: str = "default_name"):
with open(json_file_name + "_success.json", "w+") as file_to_write:
json.dump(dict(success_dict), file_to_write, indent=4)
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"generate_json_report, json_file_name: {json_file_name}, "
f"failed: {repr(error)}")
finally:
@@ -73,7 +73,7 @@ def generate_json_report(json_file_name: str = "default_name"):
with open(json_file_name + "_failure.json", "w+") as file_to_write:
json.dump(dict(failure_dict), file_to_write, indent=4)
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"generate_json_report, json_file_name: {json_file_name}, "
f"failed: {repr(error)}")
finally:
diff --git a/je_auto_control/utils/generate_report/generate_xml_report.py b/je_auto_control/utils/generate_report/generate_xml_report.py
index 2b72e84..7493c00 100644
--- a/je_auto_control/utils/generate_report/generate_xml_report.py
+++ b/je_auto_control/utils/generate_report/generate_xml_report.py
@@ -3,12 +3,12 @@
from xml.dom.minidom import parseString
from je_auto_control.utils.generate_report.generate_json_report import generate_json
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.xml.change_xml_structure.change_xml_structure import dict_to_elements_tree
def generate_xml() -> Tuple[Union[str, bytes], Union[str, bytes]]:
- auto_control_logger.info("generate_xml")
+ autocontrol_logger.info("generate_xml")
"""
:return: two dict {success_dict}, {failure_dict}
"""
@@ -21,7 +21,7 @@ def generate_xml() -> Tuple[Union[str, bytes], Union[str, bytes]]:
def generate_xml_report(xml_file_name: str = "default_name"):
- auto_control_logger.info(f"generate_xml_report, xml_file_name: {xml_file_name}")
+ autocontrol_logger.info(f"generate_xml_report, xml_file_name: {xml_file_name}")
"""
:param xml_file_name: save xml file name
"""
@@ -36,7 +36,7 @@ def generate_xml_report(xml_file_name: str = "default_name"):
with open(xml_file_name + "_failure.xml", "w+") as file_to_write:
file_to_write.write(failure_xml)
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"generate_xml_report, xml_file_name: {xml_file_name}, "
f"failed: {repr(error)}")
finally:
@@ -46,7 +46,7 @@ def generate_xml_report(xml_file_name: str = "default_name"):
with open(xml_file_name + "_success.xml", "w+") as file_to_write:
file_to_write.write(success_xml)
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"generate_xml_report, xml_file_name: {xml_file_name}, "
f"failed: {repr(error)}")
finally:
diff --git a/je_auto_control/utils/logging/loggin_instance.py b/je_auto_control/utils/logging/loggin_instance.py
index 24a14c2..14eb56f 100644
--- a/je_auto_control/utils/logging/loggin_instance.py
+++ b/je_auto_control/utils/logging/loggin_instance.py
@@ -1,15 +1,25 @@
import logging
-import sys
-auto_control_logger = logging.getLogger("AutoControl")
-auto_control_logger.setLevel(logging.INFO)
+logging.root.setLevel(logging.DEBUG)
+autocontrol_logger = logging.getLogger("AutoControlGUI")
formatter = logging.Formatter('%(asctime)s | %(name)s | %(levelname)s | %(message)s')
-# Stream handler
-stream_handler = logging.StreamHandler(stream=sys.stderr)
-stream_handler.setFormatter(formatter)
-stream_handler.setLevel(logging.WARNING)
-auto_control_logger.addHandler(stream_handler)
# File handler
-file_handler = logging.FileHandler(filename="AutoControl.log", mode="w")
+file_handler = logging.FileHandler(filename="AutoControlGUI.log", mode="w")
file_handler.setFormatter(formatter)
-auto_control_logger.addHandler(file_handler)
+autocontrol_logger.addHandler(file_handler)
+
+class APITestkaLoggingHandler(logging.Handler):
+
+ # redirect logging stderr output to queue
+
+ def __init__(self):
+ super().__init__()
+ self.formatter = formatter
+ self.setLevel(logging.DEBUG)
+
+ def emit(self, record: logging.LogRecord) -> None:
+ print(self.format(record))
+
+
+# Stream handler
+autocontrol_logger.addHandler(APITestkaLoggingHandler())
diff --git a/je_auto_control/utils/package_manager/package_manager_class.py b/je_auto_control/utils/package_manager/package_manager_class.py
index 3ac19a5..434307c 100644
--- a/je_auto_control/utils/package_manager/package_manager_class.py
+++ b/je_auto_control/utils/package_manager/package_manager_class.py
@@ -4,7 +4,7 @@
from sys import stderr
from typing import Union, Callable, Dict
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
class PackageManager(object):
@@ -32,7 +32,7 @@ def check_package(self, package: str) -> Union[None, Dict[str, Callable]]:
return self.installed_package_dict.get(package, None)
def add_package_to_executor(self, package) -> None:
- auto_control_logger.info(f"add_package_to_executor, package: {package}")
+ autocontrol_logger.info(f"add_package_to_executor, package: {package}")
"""
:param package: package's function will add to executor
"""
@@ -42,7 +42,7 @@ def add_package_to_executor(self, package) -> None:
)
def add_package_to_callback_executor(self, package) -> None:
- auto_control_logger.info(f"add_package_to_callback_executor, package: {package}")
+ autocontrol_logger.info(f"add_package_to_callback_executor, package: {package}")
"""
:param package: package's function will add to callback_executor
"""
diff --git a/je_auto_control/utils/project/create_project_structure.py b/je_auto_control/utils/project/create_project_structure.py
index f13f475..ea3cfd4 100644
--- a/je_auto_control/utils/project/create_project_structure.py
+++ b/je_auto_control/utils/project/create_project_structure.py
@@ -3,7 +3,7 @@
from threading import Lock
from je_auto_control.utils.json.json_file import write_action_json
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.project.template.template_executor import executor_template_1, \
executor_template_2, bad_executor_template_1
from je_auto_control.utils.project.template.template_keyword import template_keyword_1, \
@@ -60,7 +60,7 @@ def create_template(parent_name: str, project_path: str = None) -> None:
def create_project_dir(project_path: str = None, parent_name: str = "AutoControl") -> None:
- auto_control_logger.info(f"create_project_dir, project_path: {project_path}, parent_name: {parent_name}")
+ autocontrol_logger.info(f"create_project_dir, project_path: {project_path}, parent_name: {parent_name}")
if project_path is None:
project_path = getcwd()
create_dir(project_path + "/" + parent_name + "/keyword")
diff --git a/je_auto_control/utils/shell_process/shell_exec.py b/je_auto_control/utils/shell_process/shell_exec.py
index 9f7737a..8044051 100644
--- a/je_auto_control/utils/shell_process/shell_exec.py
+++ b/je_auto_control/utils/shell_process/shell_exec.py
@@ -4,7 +4,7 @@
import sys
from threading import Thread
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
class ShellManager(object):
@@ -32,7 +32,7 @@ def exec_shell(self, shell_command: [str, list]) -> None:
:param shell_command: shell command will run
:return: if error return result and True else return result and False
"""
- auto_control_logger.info(f"exec_shell, shell_command: {shell_command}")
+ autocontrol_logger.info(f"exec_shell, shell_command: {shell_command}")
try:
self.exit_program()
if sys.platform in ["win32", "cygwin", "msys"]:
@@ -59,7 +59,7 @@ def exec_shell(self, shell_command: [str, list]) -> None:
)
self.read_program_error_output_from_thread.start()
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"exec_shell, shell_command: {shell_command}, failed: {repr(error)}")
# tkinter_ui update method
diff --git a/je_auto_control/utils/start_exe/start_another_process.py b/je_auto_control/utils/start_exe/start_another_process.py
index f60ec65..ef38102 100644
--- a/je_auto_control/utils/start_exe/start_another_process.py
+++ b/je_auto_control/utils/start_exe/start_another_process.py
@@ -2,18 +2,18 @@
from je_auto_control.utils.exception.exception_tags import can_not_find_file
from je_auto_control.utils.exception.exceptions import AutoControlException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.shell_process.shell_exec import ShellManager
def start_exe(exe_path: str) -> None:
- auto_control_logger.info(f"start_exe, exe_path: {exe_path}")
+ autocontrol_logger.info(f"start_exe, exe_path: {exe_path}")
exe_path = Path(exe_path)
if exe_path.exists() and exe_path.is_file():
process_manager = ShellManager()
process_manager.exec_shell(str(exe_path))
else:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"start_exe, exe_path: {exe_path}, failed: {AutoControlException(can_not_find_file)}")
raise AutoControlException(can_not_find_file)
diff --git a/je_auto_control/utils/test_record/record_test_class.py b/je_auto_control/utils/test_record/record_test_class.py
index 177f912..b53d5d4 100644
--- a/je_auto_control/utils/test_record/record_test_class.py
+++ b/je_auto_control/utils/test_record/record_test_class.py
@@ -1,6 +1,6 @@
import datetime
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
class TestRecord(object):
@@ -13,7 +13,7 @@ def clean_record(self) -> None:
self.test_record_list = list()
def set_record_enable(self, set_enable: bool = True):
- auto_control_logger.info(f"set_record_enable, set_enable: {set_enable}")
+ autocontrol_logger.info(f"set_record_enable, set_enable: {set_enable}")
self.init_record = set_enable
diff --git a/je_auto_control/wrapper/auto_control_image.py b/je_auto_control/wrapper/auto_control_image.py
index 999ff61..222cd38 100644
--- a/je_auto_control/wrapper/auto_control_image.py
+++ b/je_auto_control/wrapper/auto_control_image.py
@@ -5,7 +5,7 @@
from je_auto_control.utils.exception.exception_tags import cant_find_image
from je_auto_control.utils.exception.exception_tags import find_image_error_variable
from je_auto_control.utils.exception.exceptions import ImageNotFoundException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.auto_control_mouse import click_mouse
from je_auto_control.wrapper.auto_control_mouse import set_mouse_position
@@ -19,7 +19,7 @@ def locate_all_image(image, detect_threshold: [float, int] = 1,
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal (float or int)
:param draw_image draw detect tag on return cv2_utils (bool)
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"Find multi cv2_utils {image}, with threshold {detect_threshold}"
)
param = locals()
@@ -27,7 +27,7 @@ def locate_all_image(image, detect_threshold: [float, int] = 1,
try:
image_data_array = template_detection.find_image_multi(image, detect_threshold, draw_image)
except ImageNotFoundException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Find multi cv2_utils {image}, with threshold {detect_threshold} failed. "
f"failed: {repr(find_image_error_variable + ' ' + repr(error) + ' ' + str(image))}")
raise ImageNotFoundException(find_image_error_variable + " " + repr(error) + " " + str(image))
@@ -35,13 +35,13 @@ def locate_all_image(image, detect_threshold: [float, int] = 1,
record_action_to_list("locate_all_image", param)
return image_data_array[1]
else:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Find multi cv2_utils {image}, with threshold {detect_threshold} failed. "
f"failed: {repr(ImageNotFoundException(cant_find_image + ' / ' + repr(image)))}")
raise ImageNotFoundException(cant_find_image + " / " + repr(image))
except Exception as error:
record_action_to_list("locate_all_image", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Find multi cv2_utils {image}, with threshold {detect_threshold} failed. "
f"failed: {repr(error)}")
@@ -53,14 +53,14 @@ def locate_image_center(image, detect_threshold: [float, int] = 1, draw_image: b
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal (float or int)
:param draw_image draw detect tag on return cv2_utils (bool)
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"Try to locate cv2_utils center {image} with threshold {detect_threshold}")
param = locals()
try:
try:
image_data_array = template_detection.find_image(image, detect_threshold, draw_image)
except ImageNotFoundException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Locate cv2_utils center failed. cv2_utils: {image}, with threshold {detect_threshold}, "
f"{repr(ImageNotFoundException(find_image_error_variable + ' ' + repr(error) + ' ' + str(image)))}"
)
@@ -72,14 +72,14 @@ def locate_image_center(image, detect_threshold: [float, int] = 1, draw_image: b
record_action_to_list("locate_image_center", param)
return [int(image_data_array[1][0] + center[0]), int(image_data_array[1][1] + center[1])]
else:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Locate cv2_utils center failed. cv2_utils: {image}, with threshold {detect_threshold}, "
f"failed: {repr(ImageNotFoundException(cant_find_image + ' / ' + repr(image)))}"
)
raise ImageNotFoundException(cant_find_image + " / " + repr(image))
except Exception as error:
record_action_to_list("locate_image_center", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Locate cv2_utils center failed. cv2_utils: {image}, with threshold {detect_threshold}, "
f"failed: {repr(error)}")
@@ -95,7 +95,7 @@ def locate_and_click(
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal (float or int)
:param draw_image draw detect tag on return cv2_utils (bool)
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"locate_and_click, cv2_utils: {image}, keycode: {mouse_keycode}, detect threshold: {detect_threshold}, "
f"draw cv2_utils: {draw_image}"
)
@@ -104,7 +104,7 @@ def locate_and_click(
try:
image_data_array = template_detection.find_image(image, detect_threshold, draw_image)
except ImageNotFoundException:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Locate and click failed, cv2_utils: {image}, keycode: {mouse_keycode}, "
f"detect_threshold: {detect_threshold}, "
f"failed: {repr(ImageNotFoundException(find_image_error_variable))}"
@@ -121,7 +121,7 @@ def locate_and_click(
record_action_to_list("locate_and_click", param)
return [int(image_center_x), int(image_center_y)]
else:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Locate and click failed, cv2_utils: {image}, keycode: {mouse_keycode}, "
f"detect_threshold: {detect_threshold}, "
f"failed: {repr(ImageNotFoundException(cant_find_image + ' / ' + repr(image)))}"
@@ -129,7 +129,7 @@ def locate_and_click(
raise ImageNotFoundException(cant_find_image + " / " + repr(image))
except Exception as error:
record_action_to_list("locate_and_click", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Locate and click failed, cv2_utils: {image}, keycode: {mouse_keycode}, "
f"detect_threshold: {detect_threshold}, "
f"failed: {repr(error)}"
@@ -142,7 +142,7 @@ def screenshot(file_path: str = None, region: list = None) -> List[Union[int, in
:param file_path save screenshot path (None is no save)
:param region screenshot screen_region (screenshot screen_region on screen)
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"screenshot, file path: {file_path}, region: {region}"
)
param = locals()
@@ -150,7 +150,7 @@ def screenshot(file_path: str = None, region: list = None) -> List[Union[int, in
record_action_to_list("screenshot", param)
return pil_screenshot(file_path, region)
except Exception as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"Screenshot failed, file path: {file_path}, region: {region}, "
f"failed: {repr(error)}"
)
diff --git a/je_auto_control/wrapper/auto_control_keyboard.py b/je_auto_control/wrapper/auto_control_keyboard.py
index fe07d30..8d940af 100644
--- a/je_auto_control/wrapper/auto_control_keyboard.py
+++ b/je_auto_control/wrapper/auto_control_keyboard.py
@@ -10,7 +10,7 @@
from je_auto_control.utils.exception.exception_tags import table_cant_find_key
from je_auto_control.utils.exception.exceptions import AutoControlCantFindKeyException
from je_auto_control.utils.exception.exceptions import AutoControlKeyboardException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.platform_wrapper import keyboard, special_mouse_keys_table
from je_auto_control.wrapper.platform_wrapper import keyboard_check
@@ -34,7 +34,7 @@ def press_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_record:
:param is_shift press shift True or False
:param skip_record skip record on record total list True or False
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"press_keyboard_key, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}"
)
param = locals()
@@ -43,7 +43,7 @@ def press_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_record:
try:
keycode = keyboard_keys_table.get(keycode)
except AutoControlCantFindKeyException:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_keyboard_key failed, keycode: {keycode}, is_shift: {is_shift}, "
f"failed: {repr(AutoControlCantFindKeyException(table_cant_find_key))}"
)
@@ -59,7 +59,7 @@ def press_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_record:
except AutoControlKeyboardException as error:
if skip_record is False:
record_action_to_list("press_key", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_keyboard_key failed, keycode: {keycode}, is_shift: {is_shift}, "
f"{repr(AutoControlKeyboardException(keyboard_press_key + ' ' + repr(error)))}"
)
@@ -67,7 +67,7 @@ def press_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_record:
except TypeError as error:
if skip_record is False:
record_action_to_list("press_key", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_keyboard_key failed, keycode: {keycode}, is_shift: {is_shift}, "
f"failed: {repr(AutoControlKeyboardException)}"
)
@@ -75,7 +75,7 @@ def press_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_record:
except Exception as error:
if skip_record is False:
record_action_to_list("press_key", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_keyboard_key failed, keycode: {keycode}, is_shift: {is_shift}, "
f"failed: {repr(error)}"
)
@@ -88,7 +88,7 @@ def release_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_recor
:param is_shift press shift True or False
:param skip_record skip record on record total list True or False
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"release_keyboard_key, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}"
)
param = locals()
@@ -109,7 +109,7 @@ def release_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_recor
except AutoControlKeyboardException as error:
if skip_record is False:
record_action_to_list("release_key", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"release_keyboard_key, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}, "
f"failed: {AutoControlKeyboardException(keyboard_release_key + ' ' + repr(error))}"
)
@@ -117,7 +117,7 @@ def release_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_recor
except TypeError as error:
if skip_record is False:
record_action_to_list("release_key", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"release_keyboard_key, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}, "
f"failed: {AutoControlKeyboardException(error)}"
)
@@ -125,7 +125,7 @@ def release_keyboard_key(keycode: [int, str], is_shift: bool = False, skip_recor
except Exception as error:
if skip_record is False:
record_action_to_list("release_key", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"release_keyboard_key, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}, "
f"failed: {repr(error)}"
)
@@ -138,7 +138,7 @@ def type_keyboard(keycode: [int, str], is_shift: bool = False, skip_record: bool
:param is_shift press shift True or False
:param skip_record skip record on record total list True or False
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"type_keyboard, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}"
)
param = locals()
@@ -152,7 +152,7 @@ def type_keyboard(keycode: [int, str], is_shift: bool = False, skip_record: bool
except AutoControlKeyboardException as error:
if skip_record is False:
record_action_to_list("type_keyboard", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"type_keyboard, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}, "
f"failed: {repr(AutoControlKeyboardException(keyboard_type_key + ' ' + repr(error)))}"
)
@@ -160,7 +160,7 @@ def type_keyboard(keycode: [int, str], is_shift: bool = False, skip_record: bool
except TypeError as error:
if skip_record is False:
record_action_to_list("type_keyboard", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"type_keyboard, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}, "
f"failed: {repr(AutoControlKeyboardException(repr(error)))}"
)
@@ -168,7 +168,7 @@ def type_keyboard(keycode: [int, str], is_shift: bool = False, skip_record: bool
except Exception as error:
if skip_record is False:
record_action_to_list("type_keyboard", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"type_keyboard, keycode: {keycode}, is_shift: {is_shift}, skip_record: {skip_record}, "
f"failed: {repr(error)}"
)
@@ -179,7 +179,7 @@ def check_key_is_press(keycode: [int, str]) -> bool:
use to check key is press return True or False
:param keycode check key is press or not
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"check_key_is_press, keycode: {keycode}"
)
param = locals()
@@ -192,7 +192,7 @@ def check_key_is_press(keycode: [int, str]) -> bool:
return keyboard_check.check_key_is_press(keycode=get_key_code)
except Exception as error:
record_action_to_list("check_key_is_press", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"check_key_is_press, keycode: {keycode}, "
f"failed: {repr(error)}"
)
@@ -205,7 +205,7 @@ def write(write_string: str, is_shift: bool = False) -> str:
:param write_string while string not on write_string+1 type_keyboard(string)
:param is_shift press shift True or False
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"write, write_string: {write_string}, is_shift: {is_shift}"
)
param = locals()
@@ -230,13 +230,13 @@ def write(write_string: str, is_shift: bool = False) -> str:
]
)
else:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"write, write_string: {write_string}, is_shift: {is_shift}, "
f"failed: {AutoControlKeyboardException(keyboard_write_cant_find)}"
)
raise AutoControlKeyboardException(keyboard_write_cant_find)
except AutoControlKeyboardException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"write, write_string: {write_string}, is_shift: {is_shift}, "
f"failed: {repr(error)}, keyboard_write_cant_find, {single_string}"
)
@@ -244,14 +244,14 @@ def write(write_string: str, is_shift: bool = False) -> str:
record_action_to_list("write", param)
return record_write_string
except AutoControlKeyboardException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"write, write_string: {write_string}, is_shift: {is_shift}, "
f"failed: {AutoControlKeyboardException(keyboard_write + ' ' + repr(error))}"
)
raise AutoControlKeyboardException(keyboard_write + " " + repr(error))
except Exception as error:
record_action_to_list("write", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"write, write_string: {write_string}, is_shift: {is_shift}, "
f"failed: {repr(error)}"
)
@@ -265,7 +265,7 @@ def hotkey(key_code_list: list, is_shift: bool = False) -> Tuple[str, str]:
:param key_code_list press and release all key on list and reverse
:param is_shift press shift True or False
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"hotkey, key_code_list: {key_code_list}, is_shift: {is_shift}"
)
param = locals()
@@ -291,14 +291,14 @@ def hotkey(key_code_list: list, is_shift: bool = False) -> Tuple[str, str]:
record_action_to_list("hotkey", param)
return record_hotkey_press_string, record_hotkey_release_string
except AutoControlKeyboardException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"hotkey, key_code_list: {key_code_list}, is_shift: {is_shift}, "
f"failed: {AutoControlKeyboardException(keyboard_hotkey + ' ' + repr(error))}"
)
raise AutoControlKeyboardException(keyboard_hotkey + " " + repr(error))
except Exception as error:
record_action_to_list("hotkey", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"hotkey, key_code_list: {key_code_list}, is_shift: {is_shift}, "
f"failed: {repr(error)}"
)
diff --git a/je_auto_control/wrapper/auto_control_mouse.py b/je_auto_control/wrapper/auto_control_mouse.py
index 57c39be..e7f33bd 100644
--- a/je_auto_control/wrapper/auto_control_mouse.py
+++ b/je_auto_control/wrapper/auto_control_mouse.py
@@ -12,7 +12,7 @@
from je_auto_control.utils.exception.exception_tags import table_cant_find_key
from je_auto_control.utils.exception.exceptions import AutoControlCantFindKeyException
from je_auto_control.utils.exception.exceptions import AutoControlMouseException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.auto_control_screen import screen_size
from je_auto_control.wrapper.platform_wrapper import mouse
@@ -56,7 +56,7 @@ def get_mouse_position() -> Tuple[int, int]:
get mouse current position
return mouse_x, mouse_y
"""
- auto_control_logger.info("get_mouse_position")
+ autocontrol_logger.info("get_mouse_position")
try:
try:
record_action_to_list("get_mouse_position", None)
@@ -74,7 +74,7 @@ def set_mouse_position(x: int, y: int) -> Tuple[int, int]:
:param y set mouse position y
return x, y
"""
- auto_control_logger.info(f"set_mouse_position, x: {x}, y: {y}")
+ autocontrol_logger.info(f"set_mouse_position, x: {x}, y: {y}")
param = locals()
try:
try:
@@ -82,18 +82,18 @@ def set_mouse_position(x: int, y: int) -> Tuple[int, int]:
record_action_to_list("position", param)
return x, y
except AutoControlMouseException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"set_mouse_position, x: {x}, y: {y}, "
f"failed: {AutoControlMouseException(mouse_set_position + ' ' + repr(error))}")
raise AutoControlMouseException(mouse_set_position + " " + repr(error))
except ctypes.ArgumentError as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"set_mouse_position, x: {x}, y: {y}, "
f"failed: {AutoControlMouseException(mouse_wrong_value + ' ' + repr(error))}")
raise AutoControlMouseException(mouse_wrong_value + " " + repr(error))
except Exception as error:
record_action_to_list("set_mouse_position", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"set_mouse_position, x: {x}, y: {y}, "
f"failed: {repr(error)}")
@@ -106,7 +106,7 @@ def press_mouse(mouse_keycode: [int, str], x: int = None, y: int = None) -> Tupl
:param x mouse click x position
:param y mouse click y position
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"press_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}"
)
param = locals()
@@ -120,14 +120,14 @@ def press_mouse(mouse_keycode: [int, str], x: int = None, y: int = None) -> Tupl
record_action_to_list("press_mouse", param)
return mouse_keycode, x, y
except AutoControlMouseException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}, "
f"failed: {AutoControlMouseException(mouse_press_mouse + ' ' + repr(error))}"
)
raise AutoControlMouseException(mouse_press_mouse + " " + repr(error))
except Exception as error:
record_action_to_list("press_mouse", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}, "
f"failed: {repr(error)}"
)
@@ -141,7 +141,7 @@ def release_mouse(mouse_keycode: [int, str], x: int = None, y: int = None) -> Tu
:param x mouse click x position
:param y mouse click y position
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"press_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}"
)
param = locals()
@@ -155,14 +155,14 @@ def release_mouse(mouse_keycode: [int, str], x: int = None, y: int = None) -> Tu
record_action_to_list("press_mouse", param)
return mouse_keycode, x, y
except AutoControlMouseException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}, "
f"failed: {AutoControlMouseException(mouse_release_mouse + ' ' + repr(error))}"
)
raise AutoControlMouseException(mouse_release_mouse + " " + repr(error))
except Exception as error:
record_action_to_list("release_mouse", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"press_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}, "
f"failed: {repr(error)}"
)
@@ -176,7 +176,7 @@ def click_mouse(mouse_keycode: [int, str], x: int = None, y: int = None) -> Tupl
:param x mouse click x position
:param y mouse click y position
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"click_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}"
)
param = locals()
@@ -188,14 +188,14 @@ def click_mouse(mouse_keycode: [int, str], x: int = None, y: int = None) -> Tupl
return mouse_keycode, x, y
except AutoControlMouseException as error:
record_action_to_list("click_mouse", param, mouse_click_mouse + " " + repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"click_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}, "
f"failed: {AutoControlMouseException(mouse_click_mouse + ' ' + repr(error))}"
)
raise AutoControlMouseException(mouse_click_mouse + " " + repr(error))
except Exception as error:
record_action_to_list("click_mouse", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"click_mouse, mouse_keycode: {mouse_keycode}, x: {x}, y: {y}, "
f"failed: {repr(error)}"
)
@@ -213,7 +213,7 @@ def mouse_scroll(
scroll_direction = scroll_left : direction left
scroll_direction = scroll_right : direction right
"""
- auto_control_logger.info(
+ autocontrol_logger.info(
f"mouse_scroll, scroll_value: {scroll_value}, x: {x}, y: {y}, scroll_direction: {scroll_direction}"
)
param = locals()
@@ -222,7 +222,7 @@ def mouse_scroll(
now_cursor_x, now_cursor_y = get_mouse_position()
except AutoControlMouseException as error:
record_action_to_list("scroll", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"mouse_scroll, scroll_value: {scroll_value}, x: {x}, y: {y}, scroll_direction: {scroll_direction}, "
f"failed: {AutoControlMouseException(mouse_get_position)}"
)
@@ -252,14 +252,14 @@ def mouse_scroll(
mouse.scroll(scroll_value, scroll_direction)
return scroll_value, scroll_direction
except AutoControlMouseException as error:
- auto_control_logger.error(
+ autocontrol_logger.error(
f"mouse_scroll, scroll_value: {scroll_value}, x: {x}, y: {y}, scroll_direction: {scroll_direction}, "
f"failed: {AutoControlMouseException(mouse_scroll + ' ' + repr(error))}"
)
raise AutoControlMouseException(mouse_scroll + " " + repr(error))
except Exception as error:
record_action_to_list("scroll", param, repr(error))
- auto_control_logger.error(
+ autocontrol_logger.error(
f"mouse_scroll, scroll_value: {scroll_value}, x: {x}, y: {y}, scroll_direction: {scroll_direction}, "
f"failed: {repr(error)}"
)
diff --git a/je_auto_control/wrapper/auto_control_record.py b/je_auto_control/wrapper/auto_control_record.py
index 3416e13..256d7e4 100644
--- a/je_auto_control/wrapper/auto_control_record.py
+++ b/je_auto_control/wrapper/auto_control_record.py
@@ -3,7 +3,7 @@
from je_auto_control.utils.exception.exception_tags import macos_record_error
from je_auto_control.utils.exception.exceptions import AutoControlException
from je_auto_control.utils.exception.exceptions import AutoControlJsonActionException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.platform_wrapper import recorder
@@ -12,7 +12,7 @@ def record() -> None:
"""
start record keyboard and mouse event until stop_record
"""
- auto_control_logger.info("record")
+ autocontrol_logger.info("record")
try:
if sys.platform == "darwin":
raise AutoControlException(macos_record_error)
@@ -20,14 +20,14 @@ def record() -> None:
recorder.record()
except Exception as error:
record_action_to_list("record", None, repr(error))
- auto_control_logger.error(f"record, failed: {repr(error)}")
+ autocontrol_logger.error(f"record, failed: {repr(error)}")
def stop_record() -> list:
"""
stop current record
"""
- auto_control_logger.info("stop_record")
+ autocontrol_logger.info("stop_record")
try:
if sys.platform == "darwin":
raise AutoControlException(macos_record_error)
@@ -45,4 +45,4 @@ def stop_record() -> list:
return new_list
except Exception as error:
record_action_to_list("stop_record", None, repr(error))
- auto_control_logger.error(f"stop_record, failed: {repr(error)}")
+ autocontrol_logger.error(f"stop_record, failed: {repr(error)}")
diff --git a/je_auto_control/wrapper/auto_control_screen.py b/je_auto_control/wrapper/auto_control_screen.py
index 4716e56..127b90d 100644
--- a/je_auto_control/wrapper/auto_control_screen.py
+++ b/je_auto_control/wrapper/auto_control_screen.py
@@ -7,7 +7,7 @@
from je_auto_control.utils.exception.exception_tags import screen_get_size
from je_auto_control.utils.exception.exception_tags import screen_screenshot
from je_auto_control.utils.exception.exceptions import AutoControlScreenException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.platform_wrapper import screen
@@ -16,17 +16,17 @@ def screen_size() -> Tuple[int, int]:
"""
get screen size
"""
- auto_control_logger.info("AC_screen_size")
+ autocontrol_logger.info("AC_screen_size")
try:
try:
record_action_to_list("size", None)
return screen.size()
except AutoControlScreenException:
- auto_control_logger.error(f"screen_size, failed: {repr(AutoControlScreenException(screen_get_size))}")
+ autocontrol_logger.error(f"screen_size, failed: {repr(AutoControlScreenException(screen_get_size))}")
raise AutoControlScreenException(screen_get_size)
except Exception as error:
record_action_to_list("size", None, repr(error))
- auto_control_logger.error(f"screen_size, failed: {repr(error)}")
+ autocontrol_logger.error(f"screen_size, failed: {repr(error)}")
def screenshot(file_path: str = None, screen_region: list = None) -> List[int]:
@@ -35,7 +35,7 @@ def screenshot(file_path: str = None, screen_region: list = None) -> List[int]:
:param file_path screenshot file save path
:param screen_region screenshot screen_region
"""
- auto_control_logger.info(f"screen_size, file_path: {file_path}, screen_region: {screen_region}")
+ autocontrol_logger.info(f"screen_size, file_path: {file_path}, screen_region: {screen_region}")
param = locals()
try:
try:
@@ -43,12 +43,12 @@ def screenshot(file_path: str = None, screen_region: list = None) -> List[int]:
return cv2.cvtColor(
np.array(pil_screenshot(file_path=file_path, screen_region=screen_region)), cv2.COLOR_RGB2BGR)
except AutoControlScreenException as error:
- auto_control_logger.info(
+ autocontrol_logger.info(
f"screen_size, file_path: {file_path}, screen_region: {screen_region}, "
f"failed: {AutoControlScreenException(screen_screenshot + ' ' + repr(error))}")
raise AutoControlScreenException(screen_screenshot + " " + repr(error))
except Exception as error:
record_action_to_list("AC_screenshot", None, repr(error))
- auto_control_logger.info(
+ autocontrol_logger.info(
f"screen_size, file_path: {file_path}, screen_region: {screen_region}, "
f"failed: {repr(error)}")
diff --git a/je_auto_control/wrapper/platform_wrapper.py b/je_auto_control/wrapper/platform_wrapper.py
index ec81e42..538af67 100644
--- a/je_auto_control/wrapper/platform_wrapper.py
+++ b/je_auto_control/wrapper/platform_wrapper.py
@@ -1,7 +1,7 @@
import sys
from je_auto_control.utils.exception.exceptions import AutoControlException
-from je_auto_control.utils.logging.loggin_instance import auto_control_logger
+from je_auto_control.utils.logging.loggin_instance import autocontrol_logger
if sys.platform in ["win32", "cygwin", "msys"]:
from je_auto_control.windows.core.utils.win32_vk import win32_ABSOLUTE
@@ -494,7 +494,7 @@
recorder = None
if sys.platform in ["win32", "cygwin", "msys"]:
- auto_control_logger.info("Load Windows Setting")
+ autocontrol_logger.info("Load Windows Setting")
keyboard_keys_table = {
"absolute": win32_ABSOLUTE,
"eventf_extendedkey": win32_EventF_EXTENDEDKEY,
@@ -706,7 +706,7 @@
raise AutoControlException("Can't init auto control")
elif sys.platform in ["darwin"]:
- auto_control_logger.info("Load MacOS Setting")
+ autocontrol_logger.info("Load MacOS Setting")
keyboard_keys_table = {
"a": osx_key_a,
"A": osx_key_A,
@@ -868,7 +868,7 @@
raise AutoControlException("Can't init auto control")
elif sys.platform in ["linux", "linux2"]:
- auto_control_logger.info("Load Linux x11 Setting")
+ autocontrol_logger.info("Load Linux x11 Setting")
keyboard_keys_table = {
"backspace": x11_linux_key_backspace,
"\b": x11_linux_key_slash_b,
diff --git a/pyproject.toml b/pyproject.toml
index ed32195..e1b89c9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "je_auto_control_dev"
-version = "0.0.100"
+version = "0.0.102"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
From 4895d5c2aa33e5efeed305ceb5b133f914afc4c0 Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Wed, 4 Dec 2024 14:38:06 +0800
Subject: [PATCH 4/7] Update stable version
Update stable version
---
stable.toml => dev.toml | 12 ++++++------
pyproject.toml | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
rename stable.toml => dev.toml (90%)
diff --git a/stable.toml b/dev.toml
similarity index 90%
rename from stable.toml
rename to dev.toml
index 09b147b..e1b89c9 100644
--- a/stable.toml
+++ b/dev.toml
@@ -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.158"
+name = "je_auto_control_dev"
+version = "0.0.102"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,8 +16,8 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "Pyside6",
"APScheduler",
+ "Pyside6",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
diff --git a/pyproject.toml b/pyproject.toml
index e1b89c9..4001980 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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.102"
+name = "je_auto_control"
+version = "0.0.160"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,8 +16,8 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "APScheduler",
"Pyside6",
+ "APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
From 4da67e3659af9b8f5a90f34148e456efc0f496cc Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Thu, 5 Dec 2024 04:05:32 +0800
Subject: [PATCH 5/7] Update dev and stable version
Update dev and stable version
---
dev.toml | 2 +-
je_auto_control/__init__.py | 3 +++
pyproject.toml | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dev.toml b/dev.toml
index e1b89c9..15f2265 100644
--- a/dev.toml
+++ b/dev.toml
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "je_auto_control_dev"
-version = "0.0.102"
+version = "0.0.103"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
diff --git a/je_auto_control/__init__.py b/je_auto_control/__init__.py
index 15c032d..7ef5d99 100644
--- a/je_auto_control/__init__.py
+++ b/je_auto_control/__init__.py
@@ -102,6 +102,8 @@
# import screen
from je_auto_control.wrapper.auto_control_screen import screen_size
from je_auto_control.wrapper.auto_control_screen import screenshot
+# Scheduler
+from je_auto_control.utils.scheduler.extend_apscheduler import SchedulerManager
__all__ = [
"click_mouse", "mouse_keys_table", "get_mouse_position", "press_mouse", "release_mouse",
"mouse_scroll", "set_mouse_position", "special_mouse_keys_table",
@@ -117,4 +119,5 @@
"generate_html", "generate_html_report", "generate_json", "generate_json_report", "generate_xml",
"generate_xml_report", "get_dir_files_as_list", "create_project_dir", "start_autocontrol_socket_server",
"callback_executor", "package_manager", "get_special_table", "ShellManager", "default_shell_manager",
+ "SchedulerManager"
]
diff --git a/pyproject.toml b/pyproject.toml
index 4001980..5e8c571 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "je_auto_control"
-version = "0.0.160"
+version = "0.0.161"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
From 8cf3fa9740e3ad0c5c3c1b87e25bc9171f616d2b Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Sun, 8 Dec 2024 01:55:09 +0800
Subject: [PATCH 6/7] Update dev version
Update dev version
* Fix logger name
---
.idea/discord.xml | 9 +++-
.idea/workspace.xml | 44 +++++++++++--------
.../utils/logging/loggin_instance.py | 4 +-
pyproject.toml | 12 ++---
dev.toml => stable.toml | 12 ++---
5 files changed, 48 insertions(+), 33 deletions(-)
rename dev.toml => stable.toml (90%)
diff --git a/.idea/discord.xml b/.idea/discord.xml
index cf77f1e..912db82 100644
--- a/.idea/discord.xml
+++ b/.idea/discord.xml
@@ -1,7 +1,14 @@
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index a4daa29..c09cef7 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,6 +5,7 @@
+
@@ -69,18 +70,20 @@
"Python.critical_exit_test.executor": "Run",
"Python.executor_one_file.executor": "Run",
"Python.screen_test.executor": "Run",
+ "Python.screenshot_test.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
"WebServerToolWindowFactoryState": "false",
"git-widget-placeholder": "dev",
"ignore.virus.scanning.warn.message": "true",
- "last_opened_file_path": "C:/CodeWorkspace/Python/stable-diffusion-webui",
+ "last_opened_file_path": "C:/CodeWorkspace/Python/FileAutomation",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
+ "settings.editor.selected.configurable": "discord-application",
"vue.rearranger.settings.migration": "true"
}
}]]>
@@ -100,8 +103,8 @@
-
-
+
+
@@ -110,12 +113,12 @@
-
+
-
+
@@ -124,7 +127,7 @@
-
+
@@ -133,12 +136,12 @@
-
+
-
+
@@ -147,7 +150,7 @@
-
+
@@ -156,12 +159,12 @@
-
+
-
+
@@ -170,7 +173,7 @@
-
+
@@ -179,12 +182,12 @@
-
+
-
+
@@ -218,19 +221,19 @@
+
-
-
-
+
+
@@ -534,6 +537,10 @@
+
+
+
+
@@ -565,5 +572,6 @@
+
\ No newline at end of file
diff --git a/je_auto_control/utils/logging/loggin_instance.py b/je_auto_control/utils/logging/loggin_instance.py
index 14eb56f..55157da 100644
--- a/je_auto_control/utils/logging/loggin_instance.py
+++ b/je_auto_control/utils/logging/loggin_instance.py
@@ -8,7 +8,7 @@
file_handler.setFormatter(formatter)
autocontrol_logger.addHandler(file_handler)
-class APITestkaLoggingHandler(logging.Handler):
+class AutoControlLoggingHandler(logging.Handler):
# redirect logging stderr output to queue
@@ -22,4 +22,4 @@ def emit(self, record: logging.LogRecord) -> None:
# Stream handler
-autocontrol_logger.addHandler(APITestkaLoggingHandler())
+autocontrol_logger.addHandler(AutoControlLoggingHandler())
diff --git a/pyproject.toml b/pyproject.toml
index 5e8c571..3cd70eb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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.161"
+name = "je_auto_control_dev"
+version = "0.0.104"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,8 +16,8 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "Pyside6",
"APScheduler",
+ "Pyside6",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
diff --git a/dev.toml b/stable.toml
similarity index 90%
rename from dev.toml
rename to stable.toml
index 15f2265..5e8c571 100644
--- a/dev.toml
+++ b/stable.toml
@@ -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.103"
+name = "je_auto_control"
+version = "0.0.161"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,8 +16,8 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "APScheduler",
"Pyside6",
+ "APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
From c4eece59ccaeee389c2457498f5b461391e94d1a Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Sun, 8 Dec 2024 02:05:40 +0800
Subject: [PATCH 7/7] Update stable version
---
stable.toml => dev.toml | 12 ++++++------
pyproject.toml | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
rename stable.toml => dev.toml (90%)
diff --git a/stable.toml b/dev.toml
similarity index 90%
rename from stable.toml
rename to dev.toml
index 5e8c571..3cd70eb 100644
--- a/stable.toml
+++ b/dev.toml
@@ -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.161"
+name = "je_auto_control_dev"
+version = "0.0.104"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,8 +16,8 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "Pyside6",
"APScheduler",
+ "Pyside6",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",
diff --git a/pyproject.toml b/pyproject.toml
index 3cd70eb..b56032b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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.104"
+name = "je_auto_control"
+version = "0.0.162"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,8 +16,8 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "APScheduler",
"Pyside6",
+ "APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
"python-Xlib;platform_system=='Linux'",