|
27 | 27 |
|
28 | 28 | """ |
29 | 29 |
|
30 | | -from warnings import warn |
| 30 | +from pyee.base import EventEmitter, PyeeError, PyeeException |
31 | 31 |
|
32 | | -from pyee.base import EventEmitter as EventEmitter |
33 | | -from pyee.base import PyeeException |
34 | | - |
35 | | - |
36 | | -class BaseEventEmitter(EventEmitter): |
37 | | - """ |
38 | | - BaseEventEmitter is deprecated and an alias for EventEmitter. |
39 | | - """ |
40 | | - |
41 | | - def __init__(self): |
42 | | - warn( |
43 | | - DeprecationWarning( |
44 | | - "pyee.BaseEventEmitter is deprecated and will be removed in a " |
45 | | - "future major version; you should instead use pyee.EventEmitter." |
46 | | - ) |
47 | | - ) |
48 | | - |
49 | | - super(BaseEventEmitter, self).__init__() |
50 | | - |
51 | | - |
52 | | -__all__ = ["BaseEventEmitter", "EventEmitter", "PyeeException"] |
53 | | - |
54 | | -try: |
55 | | - from pyee.asyncio import AsyncIOEventEmitter as _AsyncIOEventEmitter # noqa |
56 | | - |
57 | | - class AsyncIOEventEmitter(_AsyncIOEventEmitter): |
58 | | - """ |
59 | | - AsyncIOEventEmitter has been moved to the pyee.asyncio module. |
60 | | - """ |
61 | | - |
62 | | - def __init__(self, loop=None): |
63 | | - warn( |
64 | | - DeprecationWarning( |
65 | | - "pyee.AsyncIOEventEmitter has been moved to the pyee.asyncio " |
66 | | - "module." |
67 | | - ) |
68 | | - ) |
69 | | - super(AsyncIOEventEmitter, self).__init__(loop=loop) |
70 | | - |
71 | | - __all__.append("AsyncIOEventEmitter") |
72 | | -except ImportError: |
73 | | - pass |
74 | | - |
75 | | -try: |
76 | | - from pyee.twisted import TwistedEventEmitter as _TwistedEventEmitter # noqa |
77 | | - |
78 | | - class TwistedEventEmitter(_TwistedEventEmitter): |
79 | | - """ |
80 | | - TwistedEventEmitter has been moved to the pyee.twisted module. |
81 | | - """ |
82 | | - |
83 | | - def __init__(self): |
84 | | - warn( |
85 | | - DeprecationWarning( |
86 | | - "pyee.TwistedEventEmitter has been moved to the pyee.twisted " |
87 | | - "module." |
88 | | - ) |
89 | | - ) |
90 | | - super(TwistedEventEmitter, self).__init__() |
91 | | - |
92 | | - __all__.append("TwistedEventEmitter") |
93 | | -except ImportError: |
94 | | - pass |
95 | | - |
96 | | -try: |
97 | | - from pyee.executor import ExecutorEventEmitter as _ExecutorEventEmitter # noqa |
98 | | - |
99 | | - class ExecutorEventEmitter(_ExecutorEventEmitter): |
100 | | - """ |
101 | | - ExecutorEventEmitter has been moved to the pyee.executor module. |
102 | | - """ |
103 | | - |
104 | | - def __init__(self, executor=None): |
105 | | - warn( |
106 | | - DeprecationWarning( |
107 | | - "pyee.ExecutorEventEmitter has been moved to the pyee.executor " |
108 | | - "module." |
109 | | - ) |
110 | | - ) |
111 | | - super(ExecutorEventEmitter, self).__init__(executor=executor) |
112 | | - |
113 | | - __all__.append("ExecutorEventEmitter") |
114 | | -except ImportError: |
115 | | - pass |
116 | | - |
117 | | -try: |
118 | | - from pyee.trio import TrioEventEmitter as _TrioEventEmitter # noqa |
119 | | - |
120 | | - class TrioEventEmitter(_TrioEventEmitter): |
121 | | - """ |
122 | | - TrioEventEmitter has been moved to the pyee.trio module. |
123 | | - """ |
124 | | - |
125 | | - def __init__(self, nursery=None, manager=None): |
126 | | - warn( |
127 | | - DeprecationWarning( |
128 | | - "pyee.TrioEventEmitter has been moved to the pyee.trio module." |
129 | | - ) |
130 | | - ) |
131 | | - |
132 | | - super(TrioEventEmitter, self).__init__(nursery=nursery, manager=manager) |
133 | | - |
134 | | - __all__.append("TrioEventEmitter") |
135 | | -except (ImportError, SyntaxError): |
136 | | - pass |
| 32 | +__all__ = ["EventEmitter", "PyeeError", "PyeeException"] |
0 commit comments