def eject(self):
    "Eject disc if it hasn't previously been ejected"
    if (not self.ejected):
        self.ejected = True
        try:
            if os.system(('umount ' + self.devpath)):
                logging.debug(('we unmounted disc' + self.devpath))
            if os.system(('eject ' + self.devpath)):
                logging.debug(('we ejected disc' + self.devpath))
                self.ejected = True
            else:
                logging.debug(('failed to eject' + self.devpath))
        except Exception as e:
            logging.debug(((self.devpath + " couldn't be ejected ") + str(e)))
Eject disc if it hasn't previously been ejected
def eject(self):
    
    if (not self.ejected):
        self.ejected = True
        try:
            if os.system(('umount ' + self.devpath)):
                logging.debug(('we unmounted disc' + self.devpath))
            if os.system(('eject ' + self.devpath)):
                logging.debug(('we ejected disc' + self.devpath))
                self.ejected = True
            else:
                logging.debug(('failed to eject' + self.devpath))
        except Exception as e:
            logging.debug(((self.devpath + " couldn't be ejected ") + str(e)))