Viewing File: /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_urllib.cpython-35.opt-2.pyc



] @snddlmZmZddlmZddlmZmZmZm	Z	m
Z
mZmZdddddd	d
ddd
gfddddddddddddddddgfddgfgd dd
d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7gfdd8d9gfgiZ
e
d je
dd:d;d<ZGd=d>d>eZd?S)@)
alternates
FixImports)
fixer_base)NameComma
FromImportNewlinefind_indentationNodesymsurllibzurllib.requestZ	URLopenerZFancyURLopenerurlretrieveZ
_urlopenerurlopen
urlcleanuppathname2urlurl2pathnamezurllib.parsequote
quote_plusunquoteunquote_plus	urlencodeZ	splitattrZ	splithostZ
splitnportZsplitpasswdZ	splitportZ
splitqueryZsplittagZ	splittypeZ	splituserZ
splitvaluezurllib.errorContentTooShortErrorurllib2Zinstall_openerZbuild_openerZRequestZOpenerDirectorZBaseHandlerZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZProxyHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZHTTPHandlerZHTTPSHandlerFileHandlerZ
FTPHandlerZCacheFTPHandlerZUnknownHandlerURLError	HTTPErrorccst}xtjD]w\}}xh|D]`}|\}}t|}d||fVd|||fVd|Vd|Vd||fVq)WqWdS)Nzimport_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  zimport_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  zIimport_from< 'from' module_star=%r 'import' star='*' >
                  ztimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  zKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  )setMAPPINGitemsr)ZbareZ
old_moduleZchangeschangeZ
new_modulemembersr"//opt/alt/python35/lib64/python3.5/fix_urllib.py
build_pattern1s	
		r$c@sLeZdZddZddZddZddZd	d
ZdS)	FixUrllibcCsdjtS)N|)joinr$)selfr"r"r#r$JszFixUrllib.build_patterncCs|jd}|j}g}xEt|jddD],}|jt|dd|tgq6W|jtt|jddd||j|dS)Nmodulerrprefixr+)	getr*rvalueextendrrappendreplace)r(noderesultsZ
import_modprefnamesnamer"r"r#transform_importMs	*(zFixUrllib.transform_importcCs|jd}|j}|jd}|rt|trF|d}d}x3t|jD]$}|j|dkrZ|d}PqZW|r|jt|d|q|j|dn2g}i}	|d}
x|
D]}|j	t
jkr|jdj}|jdj}n|j}d}|d	krxct|jD]T}||dkr8|d|	kro|j
|d|	j|dgj
|q8WqWg}
t|}d
}dd}x|D]}|	|}g}x>|ddD],}|j||||j
tqW|j||d|t||}|s[|jjj|rd||_|
j
|d
}qW|
rg}x.|
ddD]}|j|tgqW|j
|
d|j|n|j|ddS)N
mod_membermemberrrr*z!This is an invalid module elementr!,TcSsz|jtjkrdt|jdjd||jdj|jdjg}ttj|gSt|jd|gS)Nrr*rr9)typerimport_as_namerchildrenr-Zcloner
)r5r*Zkidsr"r"r#handle_namesz/FixUrllib.transform_member.<locals>.handle_nameFzAll module elements are invalidr+r+r+r+)r,r*
isinstancelistrr-r0rcannot_convertr;rr<r=r/
setdefaultr	r.rrparentendswithr)r(r1r2r7r3r8new_namer modulesZmod_dictr!Zas_namemember_nameZ	new_nodesZindentationfirstr>r)Zeltsr4ZeltnewZnodesZnew_noder"r"r#transform_member]sh	



	%

	

zFixUrllib.transform_membercCs|jd}|jd}d}t|tr=|d}x3t|jD]$}|j|dkrK|d}PqKW|r|jt|d|jn|j|ddS)Nbare_with_attrr8rrr*z!This is an invalid module element)	r,r?r@rr-r0rr*rA)r(r1r2Z
module_dotr8rEr r"r"r#
transform_dots

zFixUrllib.transform_dotcCs|jdr"|j||n|jdrD|j||nc|jdrf|j||nA|jdr|j|dn|jdr|j|ddS)Nr)r7rKZmodule_starzCannot handle star imports.Z	module_asz#This module is now multiple modules)r,r6rJrLrA)r(r1r2r"r"r#	transformszFixUrllib.transformN)__name__
__module____qualname__r$r6rJrLrMr"r"r"r#r%Hs
Lr%N)Zlib2to3.fixes.fix_importsrrZlib2to3rZlib2to3.fixer_utilrrrrr	r
rrr/r$r%r"r"r"r#<module>sD4						
Back to Directory File Manager