1 import logging
2
4 """
5 This exist purely to test the saving of status data back to the
6 config file on exit so that status data is persistent.
7 """
9 """
10 One argument. When initialised from the config file it'll
11 receive a string, but we'll treat it as the string representation
12 of an integer.
13 """
14 self.name = name
15 self.logger = logging.getLogger(name)
16 self.magic_number = int(magic_number)
17 self.logger.debug('Initialised with magic_number %i' % \
18 self.magic_number)
19
21 """
22 This is the should be called when the instrument object is
23 deleted. Takes a config object as argument, and attempts to
24 set the magic_number option in the config.
25 """
26 self.logger.debug('updateConfig(%s) called' % repr(config))
27 config.set(self.name, 'magic_number', str(self.magic_number))
28