(self, key)
Remove the keyed message; raise KeyError if it doesn't exist.
Remove the keyed message; raise KeyError if it doesn't exist.
Remove the keyed message ; raise KeyError if it doesn t exist .
def remove(self, key):
        """Remove the keyed message; raise KeyError if it doesn't exist."""
        path = os.path.join(self._path, str(key))
        try:
            f = open(path, 'rb+')
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise KeyError('No message with key: %s' % key)
            else:
                raise
        else:
            f.close()
            os.remove(path)
def remove ( self , key ) : path = os . path . join ( self . _path , str ( key ) ) try : f = open ( path , 'rb+' ) except OSError as e : if e . errno == errno . ENOENT : raise KeyError ( 'No message with key: %s' % key ) else : raise else : f . close ( ) os . remove ( path )