def close(self):
        "Close the shelve object, which is needed for data consistency."
        if self.is_open:
            logger.info('closing shelve data')
            try:
                self.shelve.close()
                self._shelve.clear()
            except Exception:
                self.is_open = False
def close ( self ) : if self . is_open : logger . info ( 'closing shelve data' ) try : self . shelve . close ( ) self . _shelve . clear ( ) except Exception : self . is_open = False
Close the shelve object, which is needed for data consistency.