ACC SHELL

Path : /usr/lib/python/lib2to3/fixes/
File Upload :
Current File : //usr/lib/python/lib2to3/fixes/fix_urllib.pyc

Ñò
sÄMc@sgdZddklZlZddklZddklZlZl	Z	l
Z
lZhdddd	d
ddd
dgfddddddddddddddddgfdd gfgd!6ddd"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8gfdd9d:gfgd;6Zed;i
ed!dƒd<„Zd=efd>„ƒYZd?S(@s¾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(t
alternatest
FixImportsi(t
fixer_base(tNametCommat
FromImporttNewlinet
attr_chainsurllib.requestt	URLOpenertFancyURLOpenerturlretrievet
_urlopenerturlopent
urlcleanuptpathname2urlturl2pathnamesurllib.parsetquotet
quote_plustunquotetunquote_plust	urlencodet	splitattrt	splithostt
splitnporttsplitpasswdt	splitportt
splitquerytsplittagt	splittypet	splitusert
splitvaluesurllib.errortContentTooShortErrorturllibtinstall_openertbuild_openertRequesttOpenerDirectortBaseHandlertHTTPDefaultErrorHandlertHTTPRedirectHandlertHTTPCookieProcessortProxyHandlertHTTPPasswordMgrtHTTPPasswordMgrWithDefaultRealmtAbstractBasicAuthHandlertHTTPBasicAuthHandlertProxyBasicAuthHandlertAbstractDigestAuthHandlertHTTPDigestAuthHandlertProxyDigestAuthHandlertHTTPHandlertHTTPSHandlertFileHandlert
FTPHandlertCacheFTPHandlertUnknownHandlertURLErrort	HTTPErrorturllib2ccs•tƒ}x…tiƒD]w\}}xh|D]`}|\}}t|ƒ}d||fVd|||fVd|Vd|Vd||fVq)WqWdS(Nsimport_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  sÆimport_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  sIimport_from< 'from' module_star=%r 'import' star='*' >
                  stimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  sKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  (tsettMAPPINGtitemsR(tbaret
old_moduletchangestchanget
new_moduletmembers((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyt
build_pattern0s	
		t	FixUrllibcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCsditƒƒS(Nt|(tjoinRD(tself((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyRDIscCs™|idƒ}|i}g}x?t|id D],}|it|dd|ƒtƒgƒq0W|itt|iddd|ƒƒ|i|ƒdS(s‘Transform for the basic import case. Replaces the old
           import name with a comma separated list of its
           replacements.
        tmoduleiÿÿÿÿitprefixN(	tgetRJR<tvaluetextendRRtappendtreplace(RHtnodetresultst
import_modtpreftnamestname((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyttransform_importLs	*(cCsƒ|idƒ}|i}|idƒ}|o—t|tƒo|d}nd}x8t|iD])}|i|djo|d}Pq`q`W|o|it|d|ƒƒq|i	|dƒn»g}h}	|idƒ}
x¡|
D]™}|i}|djo}xzt|iD]g}||djoP|d|	jo|	|di
|ƒqx|g|	|d<|i
|dƒqqWqçqçWg}xˆ|D]€}|	|}
g}x4|
d	 D](}|it|d|ƒtƒgƒq²W|i
t|
d	d|ƒƒ|i
t
||ƒƒq‘W|oSg}x(|d	 D]}|i|tƒgƒq-W|i
|d	ƒ|i|ƒn|i	|d
ƒdS(sšTransform for imports of specific module elements. Replaces
           the module to be imported from with the appropriate new
           module.
        t
mod_membertmemberiiRJs!This is an invalid module elementRCt,iÿÿÿÿsAll module elements are invalidN(RKRJt
isinstancetlisttNoneR<RLRORtcannot_convertRNRMRRR(RHRPRQRWRSRXtnew_nameRAtmodulestmod_dictRCt	new_nodesRIteltsRTtelttnodestnew_node((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyttransform_member\s`	
			
!
&cCs¸|idƒ}|idƒ}d}t|tƒo|d}nx8t|iD])}|i|djo|d}PqPqPW|o |it|d|iƒƒn|i	|dƒdS(s.Transform for calls to module members in code.tbare_with_attrRXiiRJs!This is an invalid module elementN(
RKR\RZR[R<RLRORRJR](RHRPRQt
module_dotRXR^RA((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyt
transform_dot˜s
	cCs¸|idƒo|i||ƒn‘|idƒo|i||ƒnm|idƒo|i||ƒnI|idƒo|i|dƒn%|idƒo|i|dƒndS(NRIRWRgtmodule_starsCannot handle star imports.t	module_ass#This module is now multiple modules(RKRVRfRiR](RHRPRQ((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyt	transform©s(t__name__t
__module__RDRVRfRiRl(((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyREGs
			<	N(t__doc__tfix_importsRRtRt
fixer_utilRRRRRR<RNRDRE(((s./usr/lib/python2.6/lib2to3/fixes/fix_urllib.pyt<module>sD(							

ACC SHELL 2018