Your IP : 3.135.247.24


Current Path : /opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/fix_urllib.cpython-33.pyc

�
��f� c@svdZddlmZmZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
iddddd	d
ddd
gfddddddddddddddddgfddgfgd 6dd
d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7gfdd8d9gfgd:6Zed:jed d;�d<d=�ZGd>d?�d?e�Zd@S(Au�Fix changes imports of urllib which are now incompatible.
   This is rather similar to fix_imports, but because of the more
   complex nature of the fixing for urllib, it has its own fixer.
i(u
alternatesu
FixImports(u
fixer_base(uNameuCommau
FromImportuNewlineufind_indentationuNodeusymsuurllib.requestu	URLopeneruFancyURLopeneruurlretrieveu
_urlopeneruurlopenu
urlcleanupupathname2urluurl2pathnameuurllib.parseuquoteu
quote_plusuunquoteuunquote_plusu	urlencodeu	splitattru	splithostu
splitnportusplitpasswdu	splitportu
splitqueryusplittagu	splittypeu	splituseru
splitvalueuurllib.erroruContentTooShortErroruurllibuinstall_openerubuild_openeruRequestuOpenerDirectoruBaseHandleruHTTPDefaultErrorHandleruHTTPRedirectHandleruHTTPCookieProcessoruProxyHandleruHTTPPasswordMgruHTTPPasswordMgrWithDefaultRealmuAbstractBasicAuthHandleruHTTPBasicAuthHandleruProxyBasicAuthHandleruAbstractDigestAuthHandleruHTTPDigestAuthHandleruProxyDigestAuthHandleruHTTPHandleruHTTPSHandleruFileHandleru
FTPHandleruCacheFTPHandleruUnknownHandleruURLErroru	HTTPErroruurllib2iccs�t�}x�tj�D]w\}}xh|D]`}|\}}t|�}d||fVd|||fVd|Vd|Vd||fVq)WqWdS(Nu�import_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  u�import_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  uIimport_from< 'from' module_star=%r 'import' star='*' >
                  utimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  uKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  (usetuMAPPINGuitemsu
alternates(ubareu
old_moduleuchangesuchangeu
new_moduleumembers((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyu
build_pattern1s	
		u
build_patterncBsP|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS(u	FixUrllibcCsdjt��S(Nu|(ujoinu
build_pattern(uself((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyu
build_patternJsuFixUrllib.build_patterncCs�|jd�}|j}g}xEt|jdd�D],}|jt|dd|�t�g�q6W|jtt|jddd|��|j|�dS(u�Transform for the basic import case. Replaces the old
           import name with a comma separated list of its
           replacements.
        umoduleNiiuprefixi����i����(	ugetuprefixuMAPPINGuvalueuextenduNameuCommauappendureplace(uselfunodeuresultsu
import_moduprefunamesuname((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyutransform_importMs	*(uFixUrllib.transform_importcCs�|jd�}|j}|jd�}|r�t|t�rI|d}nd}x6t|jD]'}|j|dkr]|d}Pq]q]W|r�|jt|d|��q�|j	|d�n>g}i}	|d}
x�|
D]�}|j
tjkr|j
dj}|j
dj}n|j}d}|d	kr�xlt|jD]Z}||dkr>|d|	krx|j|d�n|	j|dg�j|�q>q>Wq�q�Wg}
t|�}d}d
d�}x�|D]�}|	|}g}x>|dd�D],}|j|||��|jt��q�W|j||d|��t||�}|sj|jjj|�rv||_n|
j|�d}q�W|
r�g}x.|
dd�D]}|j|t�g�q�W|j|
d�|j|�n|j	|d
�dS(u�Transform for imports of specific module elements. Replaces
           the module to be imported from with the appropriate new
           module.
        u
mod_memberumemberiiuprefixu!This is an invalid module elementumembersiu,cSsz|jtjkrdt|jdjd|�|jdj�|jdj�g}ttj|�gSt|jd|�gS(Niuprefixii(utypeusymsuimport_as_nameuNameuchildrenuvalueucloneuNode(unameuprefixukids((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyuhandle_name�su/FixUrllib.transform_member.<locals>.handle_nameNuAll module elements are invalidTi����i����Fi����i����(ugetuprefixu
isinstanceulistuNoneuMAPPINGuvalueureplaceuNameucannot_convertutypeusymsuimport_as_nameuchildrenuappendu
setdefaultufind_indentationuTrueuextenduCommau
FromImportuparentuendswithuFalseuNewline(uselfunodeuresultsu
mod_memberuprefumemberunew_nameuchangeumodulesumod_dictumembersuas_nameumember_nameu	new_nodesuindentationufirstuhandle_nameumoduleueltsunamesueltunewunodesunew_node((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyutransform_member]sh	



	+



uFixUrllib.transform_membercCs�|jd�}|jd�}d}t|t�r@|d}nx6t|jD]'}|j|dkrN|d}PqNqNW|r�|jt|d|j��n|j	|d�dS(u.Transform for calls to module members in code.ubare_with_attrumemberiiuprefixu!This is an invalid module elementN(
ugetuNoneu
isinstanceulistuMAPPINGuvalueureplaceuNameuprefixucannot_convert(uselfunodeuresultsu
module_dotumemberunew_nameuchange((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyu
transform_dot�s

uFixUrllib.transform_dotcCs�|jd�r"|j||�n�|jd�rD|j||�nf|jd�rf|j||�nD|jd�r�|j|d�n"|jd�r�|j|d�ndS(Numoduleu
mod_memberubare_with_attrumodule_staruCannot handle star imports.u	module_asu#This module is now multiple modules(ugetutransform_importutransform_memberu
transform_dotucannot_convert(uselfunodeuresults((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyu	transform�suFixUrllib.transformN(u__name__u
__module__u__qualname__u
build_patternutransform_importutransform_memberu
transform_dotu	transform(u
__locals__((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyu	FixUrllibHs
Lu	FixUrllibN(u__doc__ulib2to3.fixes.fix_importsu
alternatesu
FixImportsulib2to3u
fixer_baseulib2to3.fixer_utiluNameuCommau
FromImportuNewlineufind_indentationuNodeusymsuMAPPINGuappendu
build_patternu	FixUrllib(((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_urllib.pyu<module>sD4						

?>