oocana 0.16.3__tar.gz → 0.16.4__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.16.3
3
+ Version: 0.16.4
4
4
  Summary: python implement of oocana to give a context for oocana block
5
5
  License: MIT
6
6
  Requires-Python: >=3.9
@@ -42,9 +42,10 @@ class Context:
42
42
  __tmp_dir: str
43
43
  __package_name: str | None = None
44
44
  _logger: Optional[logging.Logger] = None
45
+ __pkg_dir: str
45
46
 
46
47
  def __init__(
47
- self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str, package_name: str
48
+ self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str, package_name: str, pkg_dir: str
48
49
  ) -> None:
49
50
 
50
51
  self.__block_info = blockInfo
@@ -61,6 +62,7 @@ class Context:
61
62
  self.__session_dir = session_dir
62
63
  self.__tmp_dir = tmp_dir
63
64
  self.__package_name = package_name
65
+ self.__pkg_dir = pkg_dir
64
66
 
65
67
  @property
66
68
  def logger(self) -> logging.Logger:
@@ -90,6 +92,12 @@ class Context:
90
92
  """
91
93
  return os.path.join(self.__tmp_dir, self.__package_name) if self.__package_name else self.__tmp_dir
92
94
 
95
+ @property
96
+ def pkg_dir(self) -> str:
97
+ """a directory for the current package, all blocks in the this package 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.
98
+ """
99
+ return self.__pkg_dir
100
+
93
101
  @property
94
102
  def keepAlive(self):
95
103
  return self.__keep_alive
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oocana"
3
- version = "0.16.3"
3
+ version = "0.16.4"
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
File without changes