import logging class ptest: """ This exist purely to test the saving of status data back to the config file on exit so that status data is persistent. """ def __init__(self, magic_number, name): """ One argument. When initialised from the config file it'll receive a string, but we'll treat it as the string representation of an integer. """ self.name = name self.logger = logging.getLogger(name) self.magic_number = int(magic_number) self.logger.debug('Initialised with magic_number %i' % \ self.magic_number) def updateConfig(self, config): """ This is the should be called when the instrument object is deleted. Takes a config object as argument, and attempts to set the magic_number option in the config. """ self.logger.debug('updateConfig(%s) called' % repr(config)) config.set(self.name, 'magic_number', str(self.magic_number))