Your IP : 18.119.112.208


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/netrc.cpython-310.opt-1.pyc

o

6��fs�@s\dZddlZddlZddlZddgZGdd�de�ZGdd�d�Zedkr,e	e��dSdS)z-An object-oriented interface to .netrc files.�N�netrc�NetrcParseErrorc@s"eZdZdZddd�Zdd�ZdS)rz5Exception raised on syntax errors in the .netrc file.NcCs"||_||_||_t�||�dS�N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r�,/opt/alt/python310/lib64/python3.10/netrc.pyr	szNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r
rrr�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__�__doc__r	r
rrrrr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNcCs�|du}|durtj�tj�d�d�}i|_i|_z"t|dd��}|�|||�Wd�WdS1s4wYWdStydt|dd��}|�|||�Wd�YdS1s\wYYdSw)N�~z.netrczutf-8)�encoding�locale)	�os�path�join�
expanduser�hosts�macros�open�_parse�UnicodeDecodeError)r
�file�
default_netrc�fprrrr	s&�&��znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_	|j}|��}}|s"dS|ddkr9|j|kr8t|�dkr8|j��q|dkrB|��}n:|dkrId}n3|dkrs|��}g|j	|<d	|_
	|j��}	|	re|	d
krid|_
n	|j	|�|	�qZqtd|||j��d}
d}}i|j
|<	|��}|�d�s�|d
vr�|r�|
||f|j
|<|�|�n�td||t|�f||j��|dks�|dkr�|��}
n�|dkr�|��}n�|dk�rAtjdk�r<|�r<t�|���}
|
jt��k�r+ddl}z
|�|
j�d}Wnt�yd|
j}Ynwz|�t���d}Wnt�ydt��}Ynwtd||f||j��|
jtjtjB@�r<td||j��|��}n	td|||j��q�q)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#��r�machine�default�macdefz 	�
z 	
zbad toplevel token %r>r"r$r%r&z&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r
rr rZlexerZsaved_linenoZtoplevelZttZ	entryname�liner(r*r+Zpropr9Zfownerr)rrrr$s�




��


��


�����
���znetrc._parsecCs,||jvr
|j|Sd|jvr|jdSdS)z8Return a (user, account, password) tuple for given host.r%N)r)r
�hostrrr�authenticatorsus




znetrc.authenticatorscCs�d}|j��D],}|j|}|d|�d|d�d�7}|dr)|d|d�d�7}|d|d	�d�7}q|j��D]}|d
|�d�7}|j|D]}||7}qH|d7}q9|S)z3Dump the class data in the format of a .netrc file.r"zmachine z
	login rr'r#z		account z
	password �zmacdef )r�keysr)r
ZreprAZattrsZmacror@rrr�__repr__~s


znetrc.__repr__r)rrrr	rrBrErrrrrs


Q	�__main__)
rrr-r=�__all__rrrr�printrrrr�<module>sx�

?>