oocana 0.16.0__py3-none-any.whl → 0.16.2__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.
oocana/context.py CHANGED
@@ -40,10 +40,11 @@ class Context:
40
40
  __keep_alive: OnlyEqualSelf = OnlyEqualSelf()
41
41
  __session_dir: str
42
42
  __tmp_dir: str
43
+ __package_name: str | None = None
43
44
  _logger: Optional[logging.Logger] = None
44
45
 
45
46
  def __init__(
46
- self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str
47
+ self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str, package_name: str
47
48
  ) -> None:
48
49
 
49
50
  self.__block_info = blockInfo
@@ -58,6 +59,8 @@ class Context:
58
59
  outputs_defs[k] = HandleDef(**v)
59
60
  self.__outputs_def = outputs_defs
60
61
  self.__session_dir = session_dir
62
+ self.__tmp_dir = tmp_dir
63
+ self.__package_name = package_name
61
64
 
62
65
  @property
63
66
  def logger(self) -> logging.Logger:
@@ -80,6 +83,12 @@ class Context:
80
83
  """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
84
  """
82
85
  return self.__tmp_dir
86
+
87
+ @property
88
+ def tmp_pkg_dir(self) -> str:
89
+ """a temporary 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.
90
+ """
91
+ return os.path.join(self.__tmp_dir, self.__package_name) if self.__package_name else self.__tmp_dir
83
92
 
84
93
  @property
85
94
  def keepAlive(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oocana
3
- Version: 0.16.0
3
+ Version: 0.16.2
4
4
  Summary: python implement of oocana to give a context for oocana block
5
5
  License: MIT
6
6
  Requires-Python: >=3.9
@@ -1,8 +1,8 @@
1
- oocana-0.16.0.dist-info/METADATA,sha256=yxd3geKmRoyhasclMwcD7eJVaq92QM_XtfxtFr6T_cU,287
2
- oocana-0.16.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- oocana-0.16.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ oocana-0.16.2.dist-info/METADATA,sha256=4MoCbLMlGoI-OL_8TyQGrseD_ctYkrRcVGdCNx_C10s,287
2
+ oocana-0.16.2.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ oocana-0.16.2.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  oocana/__init__.py,sha256=zMrQ1asZoRE91-BShf1v2ibdThaMc07YtZt5iNbbxsg,281
5
- oocana/context.py,sha256=i8W_pXRukrWOZNuVadDQayZQpyj23b4joTPdNl25ncE,12210
5
+ oocana/context.py,sha256=vdWg7oJOCPv7qFdMNBtYZ4y79il58gFUuighdSlbymA,12762
6
6
  oocana/data.py,sha256=ex042cqPHxqyRI8nuQBCguL1aLKX-7GGDughc-EAPqY,2939
7
7
  oocana/handle_data.py,sha256=p0iEvdsVV3BqcelM8rvq0a_VPI52SeahaGCszfhZ0TI,1927
8
8
  oocana/mainframe.py,sha256=VwqvjLlxLKqzzRjqPjWS-rsqRI5jiaq73l90hVBUu8g,5164
@@ -10,4 +10,4 @@ oocana/preview.py,sha256=sAKcVUFmOMvrzYLrvqAxd26SppSvK1qJqRTHdAS-KDc,1959
10
10
  oocana/schema.py,sha256=8LwMaW4eXa3EmKxR4kzyTOpZiClMRMMsMA6f9CXodW4,4332
11
11
  oocana/service.py,sha256=dPCcScQfMBlEjIodFnKU17-HlbBzrQbQK6CNRw7SmOE,2442
12
12
  oocana/throtter.py,sha256=xTldm2OZ5uYPiyC6Aatug4FJAoMylPjtXftxHvSr_50,1104
13
- oocana-0.16.0.dist-info/RECORD,,
13
+ oocana-0.16.2.dist-info/RECORD,,