Ñò §ÚêLc@sgdZddklZlZddklZddklZlZl Z l Z l Z hdddd d d d d dgfddddddddddddddddgfdd gfgd!6dd d"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 URLOpenertFancyURLOpenert urlretrievet _urlopenerturlopent urlcleanupt pathname2urlt url2pathnames urllib.parsetquotet quote_plustunquotet unquote_plust urlencodet splitattrt splithostt splitnportt splitpasswdt splitportt splitquerytsplittagt splittypet splitusert splitvalues urllib.errortContentTooShortErrorturllibtinstall_openert build_openertRequesttOpenerDirectort BaseHandlertHTTPDefaultErrorHandlertHTTPRedirectHandlertHTTPCookieProcessort ProxyHandlertHTTPPasswordMgrtHTTPPasswordMgrWithDefaultRealmtAbstractBasicAuthHandlertHTTPBasicAuthHandlertProxyBasicAuthHandlertAbstractDigestAuthHandlertHTTPDigestAuthHandlertProxyDigestAuthHandlert HTTPHandlert HTTPSHandlert FileHandlert 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((s0/usr/lib64/python2.6/lib2to3/fixes/fix_urllib.pyt build_pattern0s      t FixUrllibcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCsditƒƒS(Nt|(tjoinRD(tself((s0/usr/lib64/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((s0/usr/lib64/python2.6/lib2to3/fixes/fix_urllib.pyttransform_importLs *(c Csƒ|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](}|i t|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 ƒd S( 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((s0/usr/lib64/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((s0/usr/lib64/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(NRIRWRgt module_starsCannot handle star imports.t module_ass#This module is now multiple modules(RKRVRfRiR](RHRPRQ((s0/usr/lib64/python2.6/lib2to3/fixes/fix_urllib.pyt transform©s(t__name__t __module__RDRVRfRiRl(((s0/usr/lib64/python2.6/lib2to3/fixes/fix_urllib.pyREGs    < N(t__doc__t fix_importsRRtRt fixer_utilRRRRRR<RNRDRE(((s0/usr/lib64/python2.6/lib2to3/fixes/fix_urllib.pytsD(