osbot-utils 1.49.0__py3-none-any.whl → 1.51.0__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.
@@ -9,7 +9,7 @@ from osbot_utils.testing.Stdout import Stdout
9
9
  from osbot_utils.utils.Misc import random_id, lower
10
10
  from osbot_utils.utils.Python_Logger import Python_Logger
11
11
  from osbot_utils.utils.Str import ansis_to_texts
12
- from osbot_utils.utils.Threads import invoke_async
12
+ from osbot_utils.utils.Threads import invoke_async, invoke_in_new_event_loop
13
13
 
14
14
  FLOW__RANDOM_ID__PREFIX = 'flow_id__'
15
15
  FLOW__RANDOM_NAME__PREFIX = 'flow_name__'
@@ -86,11 +86,16 @@ class Flow(Type_Safe):
86
86
  def info(self, message):
87
87
  self.logger.info(message)
88
88
 
89
+
90
+ async def invoke_flow_target__thread(self, flow): # this is a REALLY important method which is used to pin the flow object to the call stack
91
+ return await flow.flow_target(*flow.flow_args, **flow.flow_kwargs) # which is then used by the Task.find_flow method to find it
92
+
89
93
  def invoke_flow_target(self):
90
94
  if asyncio.iscoroutinefunction(self.flow_target):
91
- self.flow_return_value = invoke_async(self.flow_target(*self.flow_args, **self.flow_kwargs))
95
+ async_coroutine = self.invoke_flow_target__thread(self) # use this special method to pin the flow object to the call stack
96
+ self.flow_return_value = invoke_in_new_event_loop(async_coroutine) # this will start a complete new thread to execute the flow (which is exactly what we want)
92
97
  else:
93
- self.flow_return_value = self.flow_target(*self.flow_args, **self.flow_kwargs)
98
+ self.flow_return_value = self.flow_target(*self.flow_args, **self.flow_kwargs) # if the flow is sync, just execute the flow target
94
99
 
95
100
  def log_captured_stdout(self, stdout):
96
101
  for line in stdout.value().splitlines():
osbot_utils/version CHANGED
@@ -1 +1 @@
1
- v1.49.0
1
+ v1.51.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osbot_utils
3
- Version: 1.49.0
3
+ Version: 1.51.0
4
4
  Summary: OWASP Security Bot - Utils
5
5
  Home-page: https://github.com/owasp-sbot/OSBot-Utils
6
6
  License: MIT
@@ -22,7 +22,7 @@ Description-Content-Type: text/markdown
22
22
 
23
23
  Powerful Python util methods and classes that simplify common apis and tasks.
24
24
 
25
- ![Current Release](https://img.shields.io/badge/release-v1.49.0-blue)
25
+ ![Current Release](https://img.shields.io/badge/release-v1.51.0-blue)
26
26
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
27
27
 
28
28
 
@@ -154,7 +154,7 @@ osbot_utils/helpers/cache_requests/Cache__Requests__Row.py,sha256=h-yc7NkpScbHww
154
154
  osbot_utils/helpers/cache_requests/Cache__Requests__Table.py,sha256=RgxAYhm-FIrXXteQRtD91pOLq8JXhSzxb51Jb6MTUdY,391
155
155
  osbot_utils/helpers/cache_requests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
156
  osbot_utils/helpers/cache_requests/flows/flow__Cache__Requests.py,sha256=xgx_oExxkcvRwQN1UCobimECIMUKGoIX5oGdCmp8Nyw,243
157
- osbot_utils/helpers/flows/Flow.py,sha256=VIhceUQpUkeI-r0DToSpfJPMQKESy2V1K1nvCNM2lRA,5888
157
+ osbot_utils/helpers/flows/Flow.py,sha256=gGvbG2LQjzZ_Sf2wPneHmJco1pv9ejXes5Z0gmWQQxk,6541
158
158
  osbot_utils/helpers/flows/Flow__Config.py,sha256=PE8hH8KXDHz1Ex93cPMuR9nkv8AoXzXQwVxleSDkU7k,341
159
159
  osbot_utils/helpers/flows/Task.py,sha256=b-EKKM4ZEXQcNDOjWHLcxkC0orhIxCOYs7Ij2aCsE7Y,4265
160
160
  osbot_utils/helpers/flows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -297,8 +297,8 @@ osbot_utils/utils/Toml.py,sha256=SD6IA4-mrtoBXcI0dIGKV9POMQNd6WYKvmDQq7GQ6ZQ,143
297
297
  osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
298
298
  osbot_utils/utils/Zip.py,sha256=G6Hk_hDcm9yvWzhTKzhT0R_6f0NBIAchHqMxGb3kfh4,14037
299
299
  osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
300
- osbot_utils/version,sha256=skh5_hS_J1ytneOFmQG3iEXvbezdPdHNIItqiUC3oz4,8
301
- osbot_utils-1.49.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
302
- osbot_utils-1.49.0.dist-info/METADATA,sha256=8CggUzubXnhKpYs1iJ17CBHtMDrJNBcBU2GPyHiFZFw,1266
303
- osbot_utils-1.49.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
304
- osbot_utils-1.49.0.dist-info/RECORD,,
300
+ osbot_utils/version,sha256=ixJmwyRL1VTzeIxW6jCmHARkd1AR8-WHR4Kue-LZ5hk,8
301
+ osbot_utils-1.51.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
302
+ osbot_utils-1.51.0.dist-info/METADATA,sha256=5xljws2rnme6CCW_3yB3uAYk7HtJ_5Tqw65q0p8p4hg,1266
303
+ osbot_utils-1.51.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
304
+ osbot_utils-1.51.0.dist-info/RECORD,,