�
m��fc@sndZddlZddlZddgZdefd��YZddd��YZedkrje�GHndS( s-An object-oriented interface to .netrc files.i����NtnetrctNetrcParseErrorcBs&eZdZddd�Zd�ZRS(s5Exception raised on syntax errors in the .netrc file.cCs/||_||_||_tj||�dS(N(tfilenametlinenotmsgt Exceptiont__init__(tselfRRR((s/usr/lib64/python2.7/netrc.pyRs cCsd|j|j|jfS(Ns%s (%s, line %s)(RRR(R((s/usr/lib64/python2.7/netrc.pyt__str__sN(t__name__t
__module__t__doc__tNoneRR(((s/usr/lib64/python2.7/netrc.pyR
scBs/eZdd�Zd�Zd�Zd�ZRS(cCs�|dkrOy tjjtjdd�}WqOtk
rKtd��qOXni|_i|_t |��}|j
||�WdQXdS(NtHOMEs.netrcs'Could not find .netrc: $HOME is not set(RtostpathtjointenvirontKeyErrortIOErrorthoststmacrostopent_parse(Rtfiletfp((s/usr/lib64/python2.7/netrc.pyRs
cCs�tj|�}|jd7_|jjdd�|_xN|j�}}|sSPn
|ddkr�t|�d}|jj|d�|jj�q9n�|dkr�|j�}n�|dkr�d}n�|dkrG|j�}g|j |<d |_
xF|jj�}|s|d
kr*d|_
Pn|j |j|�q�q9ntd|||j
��d} d}
}i|j|<x|j�}|jd�s�|ddddhkr|r�| |
|f|j|<|j|�Pq�td
||t|�f||j
��q�|dks#|dkr2|j�} q�|dkrM|j�}
q�|dkrh|j�}q�td|||j
��q�q9dS(Ns !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~t#tiitmachinetdefaulttmacdefs s
s
sbad toplevel token %rs&malformed %s entry %s terminated by %stlogintusertaccounttpasswordsbad follower token %r(tshlext wordcharst
commenterstreplacet get_tokentlentinstreamtseektreadlineRt
whitespacetappendRRRRt
startswitht
push_tokentrepr(RRRtlexerttoplevelttttpost entrynametlineRR!R"((s/usr/lib64/python2.7/netrc.pyR"sh
cCs<||jkr|j|Sd|jkr4|jdSdSdS(s8Return a (user, account, password) tuple for given host.RN(RR(Rthost((s/usr/lib64/python2.7/netrc.pytauthenticators`s
cCs�d}x�|jj�D]x}|j|}|d|dt|d�d}|drr|dt|d�}n|dt|d �d}qWxU|jj�D]D}|d
|d}x|j|D]}||}q�W|d}q�W|S(s3Dump the class data in the format of a .netrc file.Rsmachine s
login is
isaccount s
password ismacdef (RtkeysR0R(RtrepR7tattrstmacroR6((s/usr/lib64/python2.7/netrc.pyt__repr__is
$
N(R R
RRRR8R=(((s/usr/lib64/python2.7/netrc.pyRs > t__main__((RRR#t__all__RRRR (((s/usr/lib64/python2.7/netrc.pyt<module>sc |