Mini Shell

Direktori : /lib/python3.6/site-packages/blivet/devices/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/blivet/devices/__pycache__/optical.cpython-36.pyc

3

{)c!�@s^ddlZddlmZddlmZddlmZddlZejd�Zddl	m
Z
Gd	d
�d
e
�ZdS)�N�)�errors)�util)�log_method_callZblivet�)�
StorageDevicec@s2eZdZdZdZddd�Zedd	��Zd
d�ZdS)
�
OpticalDevicezJ An optical drive, eg: cdrom, dvd+r, &c.

        XXX Is this useful?
    ZcdromNF�c

Cs"tj|||||d||||	d�
dS)NT)�fmt�major�minor�exists�parents�
sysfs_path�vendor�model)r�__init__)
�self�namerrr
r
rrrr�r�/usr/lib/python3.6/optical.pyr*s
zOpticalDevice.__init__cCs~t||j|jd�|js"tjd��ytj|jtj	�}Wn4t
k
rj}z|jdkrVdSdSWYdd}~XnXtj|�dSdS)z[ Return a boolean indicating whether or not the device contains
            media.
        )�statuszdevice has not been created�{FTN)
rrrr
r�DeviceError�os�open�path�O_RDONLY�OSError�errno�close)r�fd�errr�
media_present2s


zOpticalDevice.media_presentcCsvt||j|jd�|js"tjd��|j�ytjd|jg�Wn2t	k
rp}zt
jd|j|�WYdd}~XnXdS)z Eject the drawer. )rzdevice has not been created�ejectzerror ejecting cdrom %s: %sN)rrrr
rrZteardownrZrun_programr�logZwarning)rr"rrrr$Gs
zOpticalDevice.eject)NNFNNr	r	r	)	�__name__�
__module__�__qualname__�__doc__Z_typer�propertyr#r$rrrrr"s
r)rr	rrZstorage_logrZloggingZ	getLoggerr%Zstoragerrrrrr�<module>s