We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcd2a5e commit 628f87dCopy full SHA for 628f87d
pycsw/broker/__init__.py
@@ -27,8 +27,9 @@
27
#
28
# =================================================================
29
30
+import importlib
31
+
32
from pycsw.broker.base import BasePubSubClient
-from pycsw.broker.mqtt import MQTTPubSubClient
33
34
35
def load_client(def_: dict) -> BasePubSubClient:
@@ -40,11 +41,12 @@ def load_client(def_: dict) -> BasePubSubClient:
40
41
:returns: PubSubClient object
42
"""
43
- class_ = CLIENTS[def_['type']]
44
+ module, class_ = CLIENTS[def_['type']].rsplit('.', 1)
45
+ module = importlib.import_module(module)
46
- return class_(def_)
47
+ return getattr(module, class_)(def_)
48
49
50
CLIENTS = {
- 'mqtt': MQTTPubSubClient
51
+ 'mqtt': 'pycsw.broker.mqtt.MQTTPubSubClient'
52
}
0 commit comments