-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path__init__.py
33 lines (28 loc) · 1.34 KB
/
__init__.py
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
from pkg_resources import DistributionNotFound, get_distribution
from aleph.sdk.client import AlephHttpClient, AuthenticatedAlephHttpClient, LightNode
try:
# Change here if project is renamed and does not equal the package name
dist_name = "aleph-sdk-python"
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = "unknown"
finally:
del get_distribution, DistributionNotFound
__all__ = ["AlephHttpClient", "AuthenticatedAlephHttpClient", "LightNode"]
def __getattr__(name):
if name == "AlephClient":
raise ImportError(
"AlephClient has been turned into an abstract class. Please use `AlephHttpClient` instead."
)
elif name == "AuthenticatedAlephClient":
raise ImportError(
"AuthenticatedAlephClient has been turned into an abstract class. Please use `AuthenticatedAlephHttpClient` instead."
)
elif name == "synchronous":
raise ImportError(
"The 'aleph.sdk.synchronous' type is deprecated and has been removed from the aleph SDK. Please use `aleph.sdk.client.AlephHttpClient` instead."
)
elif name == "asynchronous":
raise ImportError(
"The 'aleph.sdk.asynchronous' type is deprecated and has been removed from the aleph SDK. Please use `aleph.sdk.client.AlephHttpClient` instead."
)