oocana 0.15.3__tar.gz → 0.16.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oocana
3
- Version: 0.15.3
3
+ Version: 0.16.0
4
4
  Summary: python implement of oocana to give a context for oocana block
5
5
  License: MIT
6
6
  Requires-Python: >=3.9
@@ -39,10 +39,11 @@ class Context:
39
39
  __is_done: bool = False
40
40
  __keep_alive: OnlyEqualSelf = OnlyEqualSelf()
41
41
  __session_dir: str
42
+ __tmp_dir: str
42
43
  _logger: Optional[logging.Logger] = None
43
44
 
44
45
  def __init__(
45
- self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str
46
+ self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str
46
47
  ) -> None:
47
48
 
48
49
  self.__block_info = blockInfo
@@ -73,6 +74,12 @@ class Context:
73
74
  """a temporary directory for the current session, all blocks in the one session will share the same directory.
74
75
  """
75
76
  return self.__session_dir
77
+
78
+ @property
79
+ def tmp_dir(self) -> str:
80
+ """a temporary directory for the current follow, all blocks in the this flow will share the same directory. this directory will be cleaned if this session finish successfully, otherwise it will be kept for debugging or other purpose.
81
+ """
82
+ return self.__tmp_dir
76
83
 
77
84
  @property
78
85
  def keepAlive(self):
@@ -121,6 +128,10 @@ class Context:
121
128
  "gpu_vendor": os.getenv("OOMOL_HOST_GPU_VENDOR", "unknown"),
122
129
  "gpu_renderer": os.getenv("OOMOL_HOST_GPU_RENDERER", "unknown"),
123
130
  }
131
+
132
+ @property
133
+ def is_done(self) -> bool:
134
+ return self.__is_done
124
135
 
125
136
  def __store_ref(self, handle: str):
126
137
  return StoreKey(
@@ -38,6 +38,7 @@ class Mainframe:
38
38
  def _setup_client(self):
39
39
  self.client = mqtt.Client(
40
40
  callback_api_version=CallbackAPIVersion.VERSION2,
41
+ client_id=self.client_id,
41
42
  )
42
43
  self.client.logger = self._logger
43
44
  self.client.on_connect = self.on_connect
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oocana"
3
- version = "0.15.3"
3
+ version = "0.16.0"
4
4
  description = "python implement of oocana to give a context for oocana block"
5
5
  dependencies = [
6
6
  "paho-mqtt>=2",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes