mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
15 lines
489 B
Python
15 lines
489 B
Python
|
|
|
|
class SourceRegistry(object):
|
|
""" Central Registry for all available datasource engines"""
|
|
|
|
sources = {}
|
|
|
|
@classmethod
|
|
def register_sources(cls, datasource_config):
|
|
for module_name, class_names in datasource_config.items():
|
|
module_obj = __import__(module_name, fromlist=class_names)
|
|
for class_name in class_names:
|
|
source_class = getattr(module_obj, class_name)
|
|
cls.sources[source_class.type] = source_class
|