Skip to content

Commit a80d742

Browse files
committed
Refactor Feature & Update
Refactor Feature * Refactor callback executor Update * Dev version
1 parent 9d370f2 commit a80d742

File tree

4 files changed

+46
-41
lines changed

4 files changed

+46
-41
lines changed

.idea/workspace.xml

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

je_auto_control/utils/callback/callback_function_executor.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def callback_function(
114114
self,
115115
trigger_function_name: str,
116116
callback_function: typing.Callable,
117-
callback_function_param: dict,
117+
callback_function_param: [dict, None] = None,
118118
callback_param_method: str = "kwargs",
119119
**kwargs
120120
):
@@ -130,12 +130,15 @@ def callback_function(
130130
if trigger_function_name not in self.event_dict.keys():
131131
raise CallbackExecutorException(get_bad_trigger_function)
132132
execute_return_value = self.event_dict.get(trigger_function_name)(**kwargs)
133-
if callback_param_method not in ["kwargs", "args"]:
134-
raise CallbackExecutorException(get_bad_trigger_method)
135-
if callback_param_method == "kwargs":
136-
callback_function(**callback_function_param)
133+
if callback_function_param is not None:
134+
if callback_param_method not in ["kwargs", "args"]:
135+
raise CallbackExecutorException(get_bad_trigger_method)
136+
if callback_param_method == "kwargs":
137+
callback_function(**callback_function_param)
138+
else:
139+
callback_function(*callback_function_param.values())
137140
else:
138-
callback_function(*callback_function_param.values())
141+
callback_function()
139142
return execute_return_value
140143
except Exception as error:
141144
print(repr(error), file=stderr)

pyproject.toml

Lines changed: 6 additions & 6 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.123"
8+
name = "je_auto_control_dev"
9+
version = "0.0.57"
1010
authors = [
1111
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
1212
]
@@ -36,4 +36,4 @@ classifiers = [
3636
"Homepage" = "https://github.com/JE-Chen/AutoControl"
3737

3838
[tool.setuptools.packages]
39-
find = { }
39+
find = { namespaces = false }

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.56"
8+
name = "je_auto_control"
9+
version = "0.0.123"
1010
authors = [
1111
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
1212
]

0 commit comments

Comments
 (0)