Source

pygnetic / pygnetic / _utils.py

Diff from to

File pygnetic/_utils.py

 
 _logger = logging.getLogger(__name__)
 
-def select_adapter(a_type, names):
+
+def get_adapter(a_type, name):
+    """Return library adapter
+
+    a_type - adapter type
+    name - name of library
+    """
+    a_name = name + '_adapter'
+    try:
+        return import_module('.'.join((a_type, a_name)))
+    except ImportError as e:
+        _logger.debug("%s: %s", e.__class__.__name__, e.message)
+
+
+def find_adapter(a_type, names):
     """Return first found adapter
 
     a_type - adapter type