a  ze41@sdZddlmZddlmZmZddddddd d d d d d d ddddddddddddddddddd d!d"d"d#d$d%d&d'd(d(d(d)d*d*d+d,d-0Zd.d/Zefd0d1ZGd2d3d3ej Z d4S)5z/Fix incompatible imports and module references.) fixer_base)Name attr_chainiopicklebuiltinscopyregqueue socketserver configparserreprlibztkinter.filedialogztkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogz tkinter.dndz tkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsz tkinter.tixz tkinter.ttktkinter _markupbasewinreg_thread _dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz xmlrpc.clientz xmlrpc.serverz http.clientz html.entitiesz html.parserz http.cookieszhttp.cookiejarz http.server subprocess collectionsz urllib.parsezurllib.robotparser)0StringIO cStringIOcPickle __builtin__copy_regQueue SocketServer ConfigParserrepr FileDialog tkFileDialog SimpleDialogtkSimpleDialogtkColorChoosertkCommonDialogDialogTkdndtkFont tkMessageBox ScrolledText TkconstantsTixttkTkinter markupbase_winregthread dummy_threaddbhashdumbdbmdbmgdbm xmlrpclibDocXMLRPCServerSimpleXMLRPCServerhttplibhtmlentitydefs HTMLParserCookie cookielibBaseHTTPServerSimpleHTTPServer CGIHTTPServercommands UserStringUserListurlparse robotparsercCsddtt|dS)N(|))joinmapr)membersrJM/opt/bitninja-python-dojo/embedded/lib/python3.9/lib2to3/fixes/fix_imports.py alternates=srLccsTddd|D}t|}d||fVd|Vd||fVd|VdS)Nz | cSsg|] }d|qS)zmodule_name='%s'rJ).0keyrJrJrK Bz!build_pattern..zyname_import=import_name< 'import' ((%s) | multiple_imports=dotted_as_names< any* (%s) any* >) > zimport_from< 'from' (%s) 'import' ['('] ( any | import_as_name< any 'as' any > | import_as_names< any* >) [')'] > zimport_name< 'import' (dotted_as_name< (%s) 'as' any > | multiple_imports=dotted_as_names< any* dotted_as_name< (%s) 'as' any > any* >) > z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rGrLkeys)mappingZmod_listZ bare_namesrJrJrK build_patternAs rScsTeZdZdZdZeZdZddZfddZ fddZ fd d Z d d Z Z S) FixImportsTcCsdt|jS)NrE)rGrSrRselfrJrJrKrS`szFixImports.build_patterncs||_tt|dSN)rSZPATTERNsuperrTcompile_patternrV __class__rJrKrZcs zFixImports.compile_patterncsHtt|j|}|rDd|vr@tfddt|dDr@dS|SdS)Nbare_with_attrc3s|]}|VqdSrXrJ)rMobjmatchrJrK qrPz#FixImports.match..parentF)rYrTr`anyr)rWnoderesultsr[r_rKr`js zFixImports.matchcstt|||i|_dSrX)rYrT start_treereplace)rWZtreefilenamer[rJrKrfvszFixImports.start_treecCs|d}|rh|j}|j|}|t||jdd|vrD||j|<d|vr||}|r|||n2|dd}|j|j}|r|t||jddS)N module_name)prefixZ name_importZmultiple_importsr])getvaluerRrgrrjr` transform)rWrdreZ import_modZmod_namenew_nameZ bare_namerJrJrKrnzs     zFixImports.transform)__name__ __module__ __qualname__Z BM_compatibleZkeep_line_orderMAPPINGrRZ run_orderrSrZr`rfrn __classcell__rJrJr[rKrTUs  rTN) __doc__rZ fixer_utilrrrsrLrSZBaseFixrTrJrJrJrKsl 5