aeth-ext 2.0.0__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.
- aeth_ext/__init__.py +71 -0
- aeth_ext/_search_for_subclasses.py +940 -0
- aeth_ext/const_parsing.py +70 -0
- aeth_ext/errors/__init__.py +4 -0
- aeth_ext/errors/err_handling.py +184 -0
- aeth_ext/errors/send_alert_email.py +41 -0
- aeth_ext/ftp/__init__.py +16 -0
- aeth_ext/ftp/adapter.py +544 -0
- aeth_ext/ftp/errors.py +5 -0
- aeth_ext/ftp/types.py +116 -0
- aeth_ext/logging/__init__.py +0 -0
- aeth_ext/logging/bases.py +240 -0
- aeth_ext/logging/config.py +252 -0
- aeth_ext/logging/init.py +132 -0
- aeth_ext/monkey_patcher.py +89 -0
- aeth_ext/py.typed +0 -0
- aeth_ext/rich/__init__.py +4 -0
- aeth_ext/rich/progress.py +185 -0
- aeth_ext/settings.py +71 -0
- aeth_ext/types/__init__.py +45 -0
- aeth_ext/types/abc.py +167 -0
- aeth_ext/utils.py +240 -0
- aeth_ext-2.0.0.dist-info/METADATA +491 -0
- aeth_ext-2.0.0.dist-info/RECORD +25 -0
- aeth_ext-2.0.0.dist-info/WHEEL +4 -0
aeth_ext/__init__.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from typing import TYPE_CHECKING, Literal, overload
|
|
3
|
+
|
|
4
|
+
# First party imports
|
|
5
|
+
from aeth_ext.monkey_patcher import MonkeyPatcher
|
|
6
|
+
|
|
7
|
+
# Local folder imports
|
|
8
|
+
from .logging.init import init_logging, init_logging_worker
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
# Standard library imports
|
|
12
|
+
from collections.abc import Callable
|
|
13
|
+
|
|
14
|
+
# Local folder imports
|
|
15
|
+
from .logging.config import QueueCatchall
|
|
16
|
+
|
|
17
|
+
__all__ = ["initialize"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@overload
|
|
21
|
+
def initialize(
|
|
22
|
+
*queues: QueueCatchall,
|
|
23
|
+
asyncio: bool = False,
|
|
24
|
+
worker: bool = False,
|
|
25
|
+
run_monkey_patches: bool = True,
|
|
26
|
+
return_wrapped: Literal[False] = False,
|
|
27
|
+
) -> None: ...
|
|
28
|
+
@overload
|
|
29
|
+
def initialize(
|
|
30
|
+
*queues: QueueCatchall,
|
|
31
|
+
asyncio: bool = False,
|
|
32
|
+
worker: bool = False,
|
|
33
|
+
run_monkey_patches: bool = True,
|
|
34
|
+
return_wrapped: Literal[True],
|
|
35
|
+
) -> Callable[[], None]: ...
|
|
36
|
+
def initialize(
|
|
37
|
+
*queues: QueueCatchall,
|
|
38
|
+
asyncio: bool = False,
|
|
39
|
+
worker: bool = False,
|
|
40
|
+
run_monkey_patches: bool = True,
|
|
41
|
+
return_wrapped: bool = False,
|
|
42
|
+
) -> None | Callable[[], None]:
|
|
43
|
+
def wrapped_initialize() -> None:
|
|
44
|
+
if run_monkey_patches:
|
|
45
|
+
MonkeyPatcher.apply_monkey_patches()
|
|
46
|
+
|
|
47
|
+
if asyncio:
|
|
48
|
+
# Standard library imports
|
|
49
|
+
from sys import platform
|
|
50
|
+
|
|
51
|
+
if platform in ("win32", "cygwin", "cli"):
|
|
52
|
+
# Third party imports
|
|
53
|
+
from winloop import new_event_loop
|
|
54
|
+
else:
|
|
55
|
+
# if we're on apple or linux do this instead
|
|
56
|
+
# Third party imports
|
|
57
|
+
from uvloop import new_event_loop # type: ignore
|
|
58
|
+
# Standard library imports
|
|
59
|
+
from asyncio import set_event_loop
|
|
60
|
+
|
|
61
|
+
set_event_loop(new_event_loop())
|
|
62
|
+
|
|
63
|
+
if worker:
|
|
64
|
+
init_logging_worker(queues[0])
|
|
65
|
+
else:
|
|
66
|
+
init_logging(*queues)
|
|
67
|
+
|
|
68
|
+
if return_wrapped:
|
|
69
|
+
return wrapped_initialize
|
|
70
|
+
|
|
71
|
+
wrapped_initialize()
|