관리-도구
편집 파일: netrc.cpython-34.pyc
� f ft � @ s d Z d d l Z d d l Z d d l Z d d g Z Gd d � d e � Z Gd d � d � Z e d k r{ e e � � n d S)z-An object-oriented interface to .netrc files.� N�netrc�NetrcParseErrorc @ s4 e Z d Z d Z d d d d � Z d d � Z d S)r z5Exception raised on syntax errors in the .netrc file.Nc C s/ | | _ | | _ | | _ t j | | � d S)N)�filename�lineno�msg� Exception�__init__)�selfr r r � r �*/opt/alt/python34/lib64/python3.4/netrc.pyr s zNetrcParseError.__init__c C s d | j | j | j f S)Nz%s (%s, line %s))r r r )r r r r �__str__ s zNetrcParseError.__str__)�__name__� __module__�__qualname__�__doc__r r r r r r r s c @ sC e Z d Z d d d � Z d d � Z d d � Z d d � Z d S) r Nc C s� | d k } | d k r\ y t j j t j d d � } Wq\ t k rX t d � � Yq\ Xn i | _ i | _ t | � � } | j | | | � Wd QXd S)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 r r s znetrc.__init__c C s� t j | � } | j d 7_ | j j d d � | _ xk| j } | j � } } | s\ Pn| d d k r� | j | k r9 t | � d k r9 | j j � q9 q9 n� | d k r� | j � } n� | d k r� d } n� | d k rQ| j � } g | j | <d | _ xG | j j � } | s&| d k r3d | _ Pn | j | j | � qWq9 n t d | | | j � � d } d } } i | j | <x| j � } | j d � s�| d k r | r�| | | f | j | <| j | � Pq�t d | | t | � f | | j � � q�| d k s!| d k r0| j � } q�| d k rK| j � } q�| d k r�t j d k rt| rtt j | j � � } | j t j � k rBd d l } y | j | j � d } Wn t k r�d | j } Yn Xy | j t j � � d } Wn"