sdsstools 1.9.4__py3-none-any.whl → 1.9.5__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.
- sdsstools/daemonizer.py +14 -2
- {sdsstools-1.9.4.dist-info → sdsstools-1.9.5.dist-info}/METADATA +1 -1
- {sdsstools-1.9.4.dist-info → sdsstools-1.9.5.dist-info}/RECORD +6 -6
- {sdsstools-1.9.4.dist-info → sdsstools-1.9.5.dist-info}/WHEEL +0 -0
- {sdsstools-1.9.4.dist-info → sdsstools-1.9.5.dist-info}/entry_points.txt +0 -0
- {sdsstools-1.9.4.dist-info → sdsstools-1.9.5.dist-info}/licenses/LICENSE.md +0 -0
sdsstools/daemonizer.py
CHANGED
|
@@ -23,7 +23,19 @@ from click.decorators import pass_context
|
|
|
23
23
|
from daemonocle import Daemon
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
__all__ = ["cli_coro", "DaemonGroup"]
|
|
26
|
+
__all__ = ["cli_coro", "DaemonGroup", "get_event_loop", "daemonize"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_event_loop() -> asyncio.AbstractEventLoop:
|
|
30
|
+
"""Gets the current event loop, or creates a new one if none exists."""
|
|
31
|
+
|
|
32
|
+
try:
|
|
33
|
+
return asyncio.get_event_loop()
|
|
34
|
+
except RuntimeError:
|
|
35
|
+
# "There is no current event loop in thread %r"
|
|
36
|
+
loop = asyncio.new_event_loop()
|
|
37
|
+
asyncio.set_event_loop(loop)
|
|
38
|
+
return loop
|
|
27
39
|
|
|
28
40
|
|
|
29
41
|
def cli_coro(
|
|
@@ -35,7 +47,7 @@ def cli_coro(
|
|
|
35
47
|
def decorator_cli_coro(f):
|
|
36
48
|
@wraps(f)
|
|
37
49
|
def wrapper(*args, **kwargs):
|
|
38
|
-
loop =
|
|
50
|
+
loop = get_event_loop()
|
|
39
51
|
if shutdown_func:
|
|
40
52
|
for ss in signals:
|
|
41
53
|
loop.add_signal_handler(ss, shutdown_func, ss, loop)
|
|
@@ -2,7 +2,7 @@ sdsstools/__init__.py,sha256=G8u94gRu4THFJvptEITykK0Q_3jHqhQY9p01j9QCQH4,744
|
|
|
2
2
|
sdsstools/_tasks.py,sha256=U7fvxk9IExzE6voNjio2QqRTw-H9Upu1d0zKQlQFs5I,4263
|
|
3
3
|
sdsstools/cli.py,sha256=e4BS4b1cJThCj5tytajr_VMUvmVP1xYq_r90EtEscg8,1348
|
|
4
4
|
sdsstools/configuration.py,sha256=y_nmF_TN_o68ib2YIpdypHfwggvBpjz_dwKjNd0jzc8,14673
|
|
5
|
-
sdsstools/daemonizer.py,sha256=
|
|
5
|
+
sdsstools/daemonizer.py,sha256=Yd06BTwcAjQ9hIC3O-pQhqE5daHK-ECPZ17FzZPe3xM,8176
|
|
6
6
|
sdsstools/logger.py,sha256=nGAC_hDK0dWVMAS-a-vBsw0oSCxAwx-ZsJUE5GMzILs,18382
|
|
7
7
|
sdsstools/metadata.py,sha256=LZWO0KI-gVvzdJNIaVlIn4bBBHxbglU8BLW-MdlxOFA,3268
|
|
8
8
|
sdsstools/time.py,sha256=cqLrch0ZUCt3ShagN1v-5GhgLyNjzPXgaQRem4j7vAk,4606
|
|
@@ -15,8 +15,8 @@ sdsstools/_vendor/toml/decoder.py,sha256=hWUJ3UQ43MGVER35rSUUj7Hdh85Vat8Od_B4HeF
|
|
|
15
15
|
sdsstools/_vendor/toml/encoder.py,sha256=OBRwH2tRUhRI8nJgKBwKbkyQnBAuhcUf60r3wykjPco,9989
|
|
16
16
|
sdsstools/_vendor/toml/ordered.py,sha256=aW5woa5xOqR4BjIz9t10_lghxyhF54KQ7FqUNVv7WJ0,334
|
|
17
17
|
sdsstools/_vendor/toml/tz.py,sha256=8TAiXrTqU08sE0ruz2TXH_pFY2rlwNKE47MSE4rDo8Y,618
|
|
18
|
-
sdsstools-1.9.
|
|
19
|
-
sdsstools-1.9.
|
|
20
|
-
sdsstools-1.9.
|
|
21
|
-
sdsstools-1.9.
|
|
22
|
-
sdsstools-1.9.
|
|
18
|
+
sdsstools-1.9.5.dist-info/METADATA,sha256=3_LXoDmSXoduy2mJteBp4bVbh-uN8bG-I2yu-HhYGi0,15701
|
|
19
|
+
sdsstools-1.9.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
20
|
+
sdsstools-1.9.5.dist-info/entry_points.txt,sha256=H1UefQFMHyzmGcdNib_qxiOfFSx3351wr4c2ax0PJbQ,87
|
|
21
|
+
sdsstools-1.9.5.dist-info/licenses/LICENSE.md,sha256=_7dAUQQ5Ph_x1hcFXhi9aHBcqq9H11zco12eO4B3Cyg,1504
|
|
22
|
+
sdsstools-1.9.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|