Fix existing Driver.is_me's crashes if path is a directory.
[hooke.git] / hooke / driver / __init__.py
index cdfb4aecbecbbb7e8cd14215a532f56581cf3d10..bc38a24515b78f08dd158a934095ada0927971b7 100644 (file)
@@ -2,15 +2,15 @@
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
 #
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
+# Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with Hooke.  If not, see
@@ -25,6 +25,7 @@ to write your own to handle your lab's specific format.
 """
 
 import logging
+import os.path
 
 from ..config import Setting
 from ..util.pluggable import IsSubclass, construct_graph
@@ -51,10 +52,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):
@@ -117,7 +118,8 @@ def default_settings():
         settings.append(Setting(
                 section=DRIVER_SETTING_SECTION,
                 option=driver.name,
-                value=str(default_include),
+                value=default_include,
+                type='bool',
                 help=help,
                 ))
     for dnode in DRIVER_GRAPH: