ok

Mini Shell

Direktori : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/netrc.cpython-35.pyc



B�Mat�@s|dZddlZddlZddlZddgZGdd�de�ZGdd�d�Zedkrxe	e��dS)z-An object-oriented interface to .netrc files.�N�netrc�NetrcParseErrorc@s4eZdZdZdddd�Zdd�ZdS)rz5Exception raised on syntax errors in the .netrc file.NcCs/||_||_||_tj||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�*/opt/alt/python35/lib64/python3.5/netrc.pyrs			zNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rr
sc@sCeZdZddd�Zdd�Zdd�Zdd	�ZdS)
rNcCs�|dk}|dkrYy tjjtjdd�}Wntk
rXtd��YnXi|_i|_t|��}|j	|||�WdQRXdS)N�HOMEz.netrcz'Could not find .netrc: $HOME is not set)
�os�path�join�environ�KeyError�OSError�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs 
		znetrc.__init__cCs�tj|�}|jd7_|jjdd�|_x\|j}|j�}}|s\Pn|ddkr�|j|kr9t|�dkr9|jj�q9n�|dkr�|j�}n�|dkr�d}n�|dkrK|j�}g|j	|<d	|_
xD|jj�}	|	s#|	d
kr-d|_
P|j	|j|	�qWq9ntd|||j��d}
d}}i|j
|<x
|j�}|jd�s�|dkr|r�|
||f|j
|<|j|�Pq�td
||t|�f||j��q�|dks|dkr*|j�}
q�|dkrE|j�}q�|dkrttjdkre|retj|j��}
|
jtj�kr9ddl}y|j|
j�d}Wntk
r�d|
j}YnXy|jtj��d}Wn"tk
rdtj�}YnXtd||f||j��|
jtjtjB@retd||j��|j�}q�td|||j��q�Wq9WdS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %rz&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>r r$r"r#)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuidr�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner&r(r)Zpropr7Zfownerr'r
r
rr#s�	!
	
		






znetrc._parsecCs<||jkr|j|Sd|jkr4|jdSdSdS)z8Return a (user, account, password) tuple for given host.r#N)r)r	�hostr
r
r�authenticatorsts
znetrc.authenticatorscCs�d}x�|jj�D]u}|j|}|d|dt|d�d}|dro|dt|d�}|dt|d	�d}qWxU|jj�D]D}|d
|d}x|j|D]}||}q�W|d}q�W|S)z3Dump the class data in the format of a .netrc file.r zmachine z
	login rr%r!zaccount z
	password �zmacdef )r�keysr1r)r	Zrepr>ZattrsZmacror=r
r
r�__repr__}s
$
 znetrc.__repr__)r
rrrrr?rBr
r
r
rrsQ	�__main__)
rrr+r:�__all__rrrr
�printr
r
r
r�<module>s$w

Zerion Mini Shell 1.0