
    A"Sk                     n    d dl Z d dlZd dlmZmZ ej        Zej        Zej        ZdZ G d d          Z	dS )    N)Xerror   c                   ,    e Zd ZddZd Zd Z	 ddZdS )	
XauthorityNc                    |t           j                            d          }|T	 t           j                            t           j        d         d          }n"# t
          $ r t          j        d          w xY w	 t          |d          	                                }n)# t          $ r}t          j        d|z            d }~ww xY wg | _        d}	 |t          |          k     rJt          j        d|||d	z                      \  }|d	z   }t          j        d|||d	z                      \  }||z   d	z   }|||z
  |         }t          j        d|||d	z                      \  }||z   d	z   }|||z
  |         }t          j        d|||d	z                      \  }||z   d	z   }|||z
  |         }	t          j        d|||d	z                      \  }||z   d	z   }|||z
  |         }
t          |
          |k    rn3| j                            ||||	|
f           |t          |          k     Jn.# t          j        $ r}t!          d
|z             Y d }~nd }~ww xY wt          | j                  dk    rt!          d           d S d S )N
XAUTHORITYHOMEz.Xauthorityz($HOME not set, cannot find ~/.Xauthorityrbz~/.Xauthority: %sr   z>H   z_Xlib.xauth: warning, failed to parse part of xauthority file (%s), aborting all further parsingz4Xlib.xauth: warning, no xauthority details available)osenvirongetpathjoinKeyErrorr   
XauthErroropenreadOSErrorentrieslenstructunpackappendprint)selffilenamerawerrnfamilylengthaddrnumnamedataes               M/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/Xlib/xauth.py__init__zXauthority.__init__   s   z~~l33H@7<<
6(:MJJ @ @ @&>@ @ @@	>x&&++--CC 	> 	> 	>"#6#<===	>  	@c#hh,, -c!AaC%j99E -c!AaC%j99JN1v:>* -c!AaC%j99JN!f*q.) -c!AaC%j99JN1v:>* -c!AaC%j99JN1v:>*t99&&##VT3d$EFFF/ c#hh,,0 | 	@ 	@ 	@sv~~	@ t|!!HIIIII "!s<   0A A59"B 
C&B==CEH. .I=IIc                 *    t          | j                  S N)r   r   )r   s    r)   __len__zXauthority.__len__]   s    4<       c                     | j         |         S r,   )r   )r   is     r)   __getitem__zXauthority.__getitem__`   s    |Ar.   s   MIT-MAGIC-COOKIE-1c                 .   t          |                                          }|                                }i }| j        D ]\  }}}	}
}||k    r||k    r||	k    r|||
<    |D ]}	 |||         fc S # t          $ r Y w xY wt	          j        |||f          )a`  Find an authentication entry matching FAMILY, ADDRESS and
        DISPNO.

        The name of the auth scheme must match one of the names in
        TYPES.  If several entries match, the first scheme in TYPES
        will be choosen.

        If an entry is found, the tuple (name, data) is returned,
        otherwise XNoAuthError is raised.
        )strencoder   r   r   XNoAuthError)r   r"   addressdispnotypesr%   matchesefameaddrenumenameedatats                r)   get_best_authzXauthority.get_best_authc   s     &kk  ""..""/3| 	' 	'+D%uev~~%7"2"2sd{{!& 	 	A71:&&&     &'6!:;;;s   $	A00
A=<A=r,   )r2   )__name__
__module____qualname__r*   r-   r1   rA    r.   r)   r   r      sd        ;J ;J ;J ;J|! ! !   9< < < < < <r.   r   )
r   r   Xlibr   r   FamilyInternetFamilyDECnetFamilyChaosFamilyLocalr   rE   r.   r)   <module>rK      s   ( 
			         !~mb< b< b< b< b< b< b< b< b< b<r.   