Merged Rolf Schmidt's illysam branch
[hooke.git] / hooke / ui / gui / driver.py
1 #!/usr/bin/env python
2
3 '''
4 driver.py
5
6 Base class for file format drivers.
7
8 Copyright 2006 by Massimo Sandal (University of Bologna, Italy).
9
10 This program is released under the GNU General Public License version 2.
11 '''
12
13 import lib.plot
14
15 class Driver(object):
16     '''
17     Base class for file format drivers.
18
19     To be overridden
20     '''
21     def __init__(self):
22         self.experiment = ''
23         self.filetype = ''
24
25     def is_me(self):
26         '''
27         This method must read the file and return True if the filetype can be managed by the driver, False if not.
28         '''
29         return False
30
31     def close_all(self):
32         '''
33         This method must close all the open files of the driver, explicitly.
34         '''
35         return None
36
37     def default_plots(self):
38         plot = lib.plot.Plot()
39         plot.curves.append([0])
40         plot.curves.append([0])
41         
42         return [plot]
43
44
45