Add ability to bypass troublesome imports to hooke.util.pluggable.submods.
[hooke.git] / hooke / driver / __init__.py
index b1ba57f6312918847cb5c1e4712e62ccfb0c3c59..e51fb225e9bc5add71a229b143e4d3ab26cf7973 100644 (file)
@@ -24,6 +24,8 @@ commercial force spectroscopy microscopes are provided, and it's easy
 to write your own to handle your lab's specific format.
 """
 
+import logging
+
 from ..config import Setting
 from ..util.pluggable import IsSubclass, construct_graph
 
@@ -31,8 +33,8 @@ from ..util.pluggable import IsSubclass, construct_graph
 DRIVER_MODULES = [
 #    ('csvdriver', True),
 #    ('hdf5', True),
-#    ('hemingclamp', True),
-#    ('jpk', True),
+    ('hemingway', True),
+    ('jpk', True),
 #    ('mcs', True),
 #    ('mfp1dexport', True),
     ('mfp3d', True),
@@ -49,10 +51,10 @@ DRIVER_SETTING_SECTION = 'drivers'
 """
 
 
-class Driver(object):
+class Driver (object):
     """Base class for file format drivers.
     
-    :attr:`name` identifies your driver, and should match the module
+    :attr:`name` identifies your driver and should match the module
     name.
     """
     def __init__(self, name):
@@ -79,16 +81,22 @@ class Driver(object):
         """
         return False
 
-    def read(self, path):
+    def read(self, path, info=None):
         """Read data from `path` and return a
         ([:class:`hooke.curve.Data`, ...], `info`) tuple.
 
+        The input `info` :class:`dict` may contain attributes read
+        from the :class:`~hooke.playlist.FilePlaylist`.
+
         The `info` :class:`dict` must contain values for the keys:
         'filetype' and 'experiment'.  See :class:`hooke.curve.Curve`
         for details.
         """
         raise NotImplementedError
 
+    def logger(self):
+        return logging.getLogger('hooke')
+
 # Construct driver dependency graph and load default drivers.
 
 DRIVER_GRAPH = construct_graph(