Package dics :: Module ptest
[hide private]
[frames] | no frames]

Source Code for Module dics.ptest

 1  import logging 
 2   
3 -class ptest:
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 """
8 - def __init__(self, magic_number, name):
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
20 - def updateConfig(self, config):
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