a
    ñ»jç  ã                   @   s0   d dl mZ d dlmZ dZG dd„ deƒZdS )é    )ÚEasyProcess)ÚAbstractDisplayZXvfbc                   @   s2   e Zd ZdZddd„Zedd	„ ƒZed
d„ ƒZdS )ÚXvfbDisplayz½
    Xvfb wrapper

    Xvfb is an X server that can run on machines with no display
    hardware and no physical input devices. It emulates a dumb
    framebuffer using virtual memory.
    ©i   i   é   ÚblackNc                 C   s8   d| _ || _|| _d| _|| _d| _|| _t | ¡ dS )zº
        :param bgcolor: 'black' or 'white'
        :param fbdir: If non-null, the virtual screen is memory-mapped
            to a file in the given directory ('-fbdir' option)
        r   N)	ÚscreenÚsizeÚcolor_depthÚprocessÚbgcolorÚdisplayÚfbdirr   Ú__init__)Úselfr	   r
   r   r   © r   ú;E:\soccer\ml_env\Lib\site-packages\sbvirtualdisplay/xvfb.pyr      s    zXvfbDisplay.__init__c                 C   s$   t tdgƒ}d|_d|_| ¡  d S )Nz-helpF)r   ÚPROGRAMZenable_stdout_logZenable_stderr_logÚcall)ÚclsÚpr   r   r   Úcheck_installed!   s    zXvfbDisplay.check_installedc                 C   s`   t ddd�| j dddt| jƒd ttt| jƒ| jg ƒ¡| j	g}| j
rV|d| j
g7 }tg| S )	Nz-brz-wr)r   Úwhitez	-nolistenZtcpz-screenÚxz-fbdir)Údictr   Ústrr   ÚjoinÚmapÚlistr	   r
   Znew_display_varr   r   )r   Úcmdr   r   r   Ú_cmd(   s    ù	zXvfbDisplay._cmd)r   r   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úclassmethodr   Úpropertyr    r   r   r   r   r      s   	 ÿ

r   N)Zsbvirtualdisplay.easyprocessr   Z sbvirtualdisplay.abstractdisplayr   r   r   r   r   r   r   Ú<module>   s   