ddeutil-workflow 0.0.56__py3-none-any.whl → 0.0.57__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,14 @@ class Status(IntEnum):
37
37
  SKIP: int = 3
38
38
  CANCEL: int = 4
39
39
 
40
+ @property
41
+ def emoji(self) -> str:
42
+ """Return the emoji value of this status.
43
+
44
+ :rtype: str
45
+ """
46
+ return {0: "✅", 1: "❌", 2: "🟡", 3: "⏩", 4: "🚫"}[self.value]
47
+
40
48
 
41
49
  SUCCESS = Status.SUCCESS
42
50
  FAILED = Status.FAILED
@@ -46,10 +54,7 @@ CANCEL = Status.CANCEL
46
54
 
47
55
 
48
56
  @dataclass(
49
- config=ConfigDict(
50
- arbitrary_types_allowed=True,
51
- use_enum_values=True,
52
- ),
57
+ config=ConfigDict(arbitrary_types_allowed=True, use_enum_values=True),
53
58
  )
54
59
  class Result:
55
60
  """Result Pydantic Model for passing and receiving data context from any
@@ -3,7 +3,6 @@
3
3
  # Licensed under the MIT License. See LICENSE in the project root for
4
4
  # license information.
5
5
  # ------------------------------------------------------------------------------
6
- # [x] Use dynamic config
7
6
  """The main schedule running is `schedule_runner` function that trigger the
8
7
  multiprocess of `schedule_control` function for listing schedules on the
9
8
  config by `Loader.finds(Schedule)`.
@@ -17,6 +16,11 @@ functions; `workflow_task`, and `workflow_monitor`.
17
16
  The `schedule_task` will run `task.release` method in threading object
18
17
  for multithreading strategy. This `release` method will run only one crontab
19
18
  value with the on field.
19
+
20
+ Steps:
21
+ - Extract all schedule config on the conf path.
22
+ - Slice schedules to multiprocess
23
+ - Start running task.
20
24
  """
21
25
  from __future__ import annotations
22
26
 
@@ -699,7 +703,7 @@ def schedule_control(
699
703
  :rtype: Result
700
704
  """
701
705
  audit: type[Audit] = audit or get_audit(extras=extras)
702
- result: Result = Result().set_parent_run_id(parent_run_id)
706
+ result: Result = Result.construct_with_rs_or_id(parent_run_id=parent_run_id)
703
707
 
704
708
  # NOTE: Create the start and stop datetime.
705
709
  start_date: datetime = datetime.now(tz=dynamic("tz", extras=extras))