Moved hooke.libhookecurve -> hooke.curve and rewrote HookeCurve -> Curve class.
[hooke.git] / hooke / driver / __init__.py
1 class NotRecognized (ValueError):
2     def __init__(self, path):
3         msg = 'Not a recognizable curve format: %s' % self.path
4         ValueError.__init__(self, msg)
5         self.path = path
6
7 class Driver(object):
8     '''
9     Base class for file format drivers.
10
11     To be overridden
12     '''
13     def __init__(self):
14         self.experiment = ''
15         self.filetype = ''
16
17     def is_me(self):
18         '''
19         This method must read the file and return True if the filetype can be managed by the driver, False if not.
20         '''
21         return False
22
23     def close_all(self):
24         '''
25         This method must close all the open files of the driver, explicitly.
26         '''
27         return None
28
29     def default_plots(self):
30         dummy_default = PlotObject()
31         dummy_default.vectors.append([[[0]],[[0]]])
32         return [dummy_default]