Fix existing Driver.is_me's crashes if path is a directory.
[hooke.git] / hooke / driver / hemingway.py
index 0c8ff36c1fa18a123adb34440f10d0f3df755abd..5803800191d6e8c942b3b1e78c2a888faed2ea17 100644 (file)
@@ -20,6 +20,7 @@
 """Library for interpreting Hemingway force spectroscopy files.
 """
 
+import os.path
 import numpy
 
 from .. import curve as curve
@@ -35,6 +36,8 @@ class HemingwayDriver (Driver):
         super(HemingwayDriver, self).__init__(name='hemingway')
 
     def is_me(self, path):
+        if os.path.isdir(path):
+            return False
         headlines = []
         with Closing(file(path, 'r')) as f:
             for i in range(2):