idPdZddlZddlZddlZGddeZdZdZdZdS)zUtility functions for xauth.NceZdZdZdS) NotFoundErrorzError when xauth was not found.N)__name__ __module__ __qualname____doc__K/opt/cloudlinux/venv/lib/python3.11/site-packages/pyvirtualdisplay/xauth.pyrrs))))r rc tjddgtjtj}|\}}dS#t$rYdSwxYw)z3 Return whether or not xauth is installed. xauthz-VstdoutstderrTF) subprocessPopenPIPE communicateFileNotFoundError)r _s r is_installedr sq dO??       ""1t uusAA AAcvtjd}tj|S)z6 Generate a cookie string suitable for xauth. )osurandomhashlibmd5 hexdigest)datas r generate_mcookier !s- :b>>D ;t   & & ( ((r ctjdgt|ztjtj}|\}}dS)z) Call xauth with the given args. r rN)rrlistrr)argsr rs r callr$)sP    DJJ    E     DAqqqr ) rrrr Exceptionrrr r$r r r r&s"" *****I***,)))     r