ominfra 0.0.0.dev230__py3-none-any.whl → 0.0.0.dev232__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.
@@ -1966,11 +1966,13 @@ class Pidfile:
1966
1966
  path: str,
1967
1967
  *,
1968
1968
  inheritable: bool = True,
1969
+ no_create: bool = False,
1969
1970
  ) -> None:
1970
1971
  super().__init__()
1971
1972
 
1972
1973
  self._path = path
1973
1974
  self._inheritable = inheritable
1975
+ self._no_create = no_create
1974
1976
 
1975
1977
  @property
1976
1978
  def path(self) -> str:
@@ -1995,8 +1997,28 @@ class Pidfile:
1995
1997
 
1996
1998
  #
1997
1999
 
2000
+ _fd_to_dup: int
2001
+
2002
+ def dup(self) -> 'Pidfile':
2003
+ fd = self._f.fileno()
2004
+ dup = Pidfile(
2005
+ self._path,
2006
+ inheritable=self._inheritable,
2007
+ )
2008
+ dup._fd_to_dup = fd # noqa
2009
+ return dup
2010
+
2011
+ #
2012
+
1998
2013
  def __enter__(self) -> 'Pidfile':
1999
- fd = os.open(self._path, os.O_RDWR | os.O_CREAT, 0o600)
2014
+ if hasattr(self, '_fd_to_dup'):
2015
+ fd = os.dup(self._fd_to_dup)
2016
+ del self._fd_to_dup
2017
+ else:
2018
+ ofl = os.O_RDWR
2019
+ if not self._no_create:
2020
+ ofl |= os.O_CREAT
2021
+ fd = os.open(self._path, ofl, 0o600)
2000
2022
 
2001
2023
  try:
2002
2024
  if self._inheritable:
ominfra/scripts/manage.py CHANGED
@@ -101,7 +101,7 @@ CheckExceptionFactory = ta.Callable[..., Exception] # ta.TypeAlias
101
101
  CheckArgsRenderer = ta.Callable[..., ta.Optional[str]] # ta.TypeAlias
102
102
 
103
103
  # ../../omlish/lite/timeouts.py
104
- TimeoutLike = ta.Union['Timeout', 'Timeout.Default', ta.Iterable['TimeoutLike'], float] # ta.TypeAlias
104
+ TimeoutLike = ta.Union['Timeout', ta.Type['Timeout.Default'], ta.Iterable['TimeoutLike'], float] # ta.TypeAlias
105
105
 
106
106
  # ../../omlish/lite/typing.py
107
107
  A0 = ta.TypeVar('A0')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ominfra
3
- Version: 0.0.0.dev230
3
+ Version: 0.0.0.dev232
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.12
14
14
  License-File: LICENSE
15
- Requires-Dist: omdev==0.0.0.dev230
16
- Requires-Dist: omlish==0.0.0.dev230
15
+ Requires-Dist: omdev==0.0.0.dev232
16
+ Requires-Dist: omlish==0.0.0.dev232
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -112,8 +112,8 @@ ominfra/manage/targets/connection.py,sha256=rVI1YJxFClcF-sdttqWyIz9_XjPI01GUdwxY
112
112
  ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhhMcE,1561
113
113
  ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-WB6U,1885
114
114
  ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
- ominfra/scripts/journald2aws.py,sha256=NUfhLpV9LFZeyQWNRkkCXYGMdPXyD2gj4F5PwDfxeDU,164683
116
- ominfra/scripts/manage.py,sha256=rtTs5tm5RH9A6G6XgHSUi8bfWDkmpbPPx6TYoO_g-HM,373799
115
+ ominfra/scripts/journald2aws.py,sha256=EpBwLz3adwVRN7RX6YnqpE5LtCDbkl4LE-4R5khzGWc,165212
116
+ ominfra/scripts/manage.py,sha256=4wsf9ITEhCAbwyu281y_-kp0QtTUv96YTSXgzGaMcK4,373808
117
117
  ominfra/scripts/supervisor.py,sha256=8vVoR8kq7Qh2z_NdOrDXXnNCu9N5TnOM2M5om4D-ZmA,296097
118
118
  ominfra/supervisor/LICENSE.txt,sha256=ZrHY15PVR98y26Yg6iQfa-SXnUaYTDhrUsPVcEO5OKM,1874
119
119
  ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
@@ -156,9 +156,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
156
156
  ominfra/tailscale/cli.py,sha256=3FnJbgpLw6gInTfhERd1mDy9ijjMUGxkdYVo43Tnxx4,3555
157
157
  ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
158
158
  ominfra/tools/listresources.py,sha256=BxFoxtyF2aVEcW67ZD9QujoBkJBtvIxGmKqXvLwnEHo,6180
159
- ominfra-0.0.0.dev230.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
160
- ominfra-0.0.0.dev230.dist-info/METADATA,sha256=CcFBKXEINUlZGenKJ039GVtQlvH9lki_1H3-hMr5elQ,731
161
- ominfra-0.0.0.dev230.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
162
- ominfra-0.0.0.dev230.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
163
- ominfra-0.0.0.dev230.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
164
- ominfra-0.0.0.dev230.dist-info/RECORD,,
159
+ ominfra-0.0.0.dev232.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
160
+ ominfra-0.0.0.dev232.dist-info/METADATA,sha256=YI-SMuFDhFrSMzRpEv-cIHYy3Ha_sy8O2CWxO_22EG4,731
161
+ ominfra-0.0.0.dev232.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
162
+ ominfra-0.0.0.dev232.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
163
+ ominfra-0.0.0.dev232.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
164
+ ominfra-0.0.0.dev232.dist-info/RECORD,,