Add 'block names' argument to 'curve info'.
[hooke.git] / hooke / driver / tutorial.py
index 42204d3d5670665fae4b99832e54ad1350825e72..6856f8dd3e05899545268c769d25e24c06eb2331 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
@@ -61,6 +61,8 @@ file format is as following::
 that is, two plots with two datasets each.
 """
 
+import os.path
+
 # The following are relative imports.  See PEP 328 for details
 #   http://www.python.org/dev/peps/pep-0328/
 from .. import curve as curve # this module defines data containers.
@@ -105,6 +107,8 @@ class TutorialDriver (Driver):
         Hooke to understand what kind of files we're looking at
         automatically.
         """
+        if os.path.isdir(path):
+            return False
 
         f = open(path, 'r')
         header = f.readline() # we only need the first line
@@ -132,5 +136,5 @@ class TutorialDriver (Driver):
         f.close() # remember to close the file
 
         data = curve.Data()
-        info = {'filetype':'tutorial', 'experiment':experiment.Experiment}
+        info = {'filetype':'tutorial', 'experiment':experiment.Experiment()}
         return (data, info)