
    *f                     V    d dl Z d dlmZ  e j                  e      ZdZ G d de      Zy)    N)AbstractDisplayXvfbc            	       6    e Zd ZdZdddddddg df	d	Zd
 Zd Zy)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      blackFN
   Tc
                     d| _         || _        || _        || _        || _        || _        t        j                  | t        ||||	       y)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)
        :param dpi: screen resolution in dots per inch if not None
        r   )	use_xauthretries
extra_argsmanage_global_envN)	_screen_size_color_depth_bgcolor_fbdir_dpir   __init__PROGRAM)
selfsizecolor_depthbgcolorr   fbdirdpir   r   r   s
             R/var/www/html/flask-app/venv/lib/python3.12/site-packages/pyvirtualdisplay/xvfb.pyr   zXvfbDisplay.__init__   sO    $ 
'	  !/	
    c                      y )N )r   helptexts     r   _check_flagszXvfbDisplay._check_flags5   s    r   c                    t        dd      | j                     dddt        | j                        dj	                  t        t        t        | j                        | j                  gz               g}| j                  r|d| j                  gz  }| j                  |d	t        | j                        gz  }| j                  r|d
t        | j                        gz  }n|| j                  gz  }t        g|z   S )Nz-brz-wr)r   whitez	-nolistentcpz-screenxz-fbdirz-dpiz
-displayfd)dictr   strr   joinmaplistr   r   r   r   _has_displayfd	_pipe_wfdnew_display_varr   )r   cmds     r   _cmdzXvfbDisplay._cmd8   s    uE*4==9HHSd4::.$2C2C1DDEF
 ;;Hdkk**C99 FC		N++CL#dnn"566CD(())Cy3r   )__name__
__module____qualname____doc__r   r"   r0   r    r   r   r   r   
   s4      
Dr   r   )logging pyvirtualdisplay.abstractdisplayr   	getLoggerr1   logr   r   r    r   r   <module>r9      s.     <g!
?/ ?r   