File size: 1,577 Bytes
1380717
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from __future__ import annotations

import typing as t

from .base import ANY
from .base import default_namespace
from .base import NamedSignal
from .base import Namespace
from .base import Signal
from .base import signal

__all__ = [
    "ANY",
    "default_namespace",
    "NamedSignal",
    "Namespace",
    "Signal",
    "signal",
]


def __getattr__(name: str) -> t.Any:
    import warnings

    if name == "__version__":
        import importlib.metadata

        warnings.warn(
            "The '__version__' attribute is deprecated and will be removed in"
            " Blinker 1.9.0. Use feature detection or"
            " 'importlib.metadata.version(\"blinker\")' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        return importlib.metadata.version("blinker")

    if name == "receiver_connected":
        from .base import _receiver_connected

        warnings.warn(
            "The global 'receiver_connected' signal is deprecated and will be"
            " removed in Blinker 1.9. Use 'Signal.receiver_connected' and"
            " 'Signal.receiver_disconnected' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        return _receiver_connected

    if name == "WeakNamespace":
        from .base import _WeakNamespace

        warnings.warn(
            "'WeakNamespace' is deprecated and will be removed in Blinker 1.9."
            " Use 'Namespace' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        return _WeakNamespace

    raise AttributeError(name)