ó DŃŐfc@sZdZddlmZedddƒ[ddlZddlZddlZddlZddlZddd gZe d ƒZ e eƒZ ddd „ƒYZ ddd „ƒYZ eržd pÁdZdeZd„Zdaad„Zd„Zd„Zd e fd„ƒYZde fd„ƒYZd„Zddd„ƒYZd„Zd„ZdS(s Import utilities Exported classes: ImportManager Manage the import process Importer Base class for replacing standard import functions BuiltinImporter Emulate the import mechanism for builtin and frozen modules DynLoadSuffixImporter i˙˙˙˙(twarnpy3ks1the imputil module has been removed in Python 3.0t stackleveliNt ImportManagertImportertBuiltinImportertcBsqeZdZeeƒd„Zd„Zd„Zd Z d d„Z d d d d„Z d„Z d„Z d„ZRS( sManage the import process.cCsEt|tƒrt|ƒ}n|d|_||_|j|d imported the parent module. iR"iN(R<RKRR0(R R8R7R6ttop_namet top_fqnameR:((s/usr/lib64/python2.7/imputil.pyR'_s  cCs td‚dS(sŁFind and retrieve the code for the given module. parent specifies a parent module to define a context for importing. It may be None, indicating no particular context for the search. modname specifies a single module (not dotted) within the parent. fqname specifies the fully-qualified module name. This is a (potentially) dotted name from the "root" of the module namespace down to the modname. If there is no parent, then modname==fqname. This method should return None, or a 3-tuple. * If the module was not found, then None should be returned. * The first item of the 2- or 3-tuple should be the integer 0 or 1, specifying whether the module that was found is a package or not. * The second item is the code object for the module (it will be executed within the new module's namespace). This item can also be a fully-loaded module object (e.g. loaded from a shared lib). * The third item is a dictionary of name/value pairs that will be inserted into new module before the code object is executed. This is provided in case the module's code expects certain values (such as where the module was found). When the second item is a module object, then these names/values will be inserted *after* the module has been loaded/initialized. sget_code not implementedN(t RuntimeError(R R8RSR3((s/usr/lib64/python2.7/imputil.pyRPrs( R<RHRIRCR0RKRQRLRMR'RP(((s/usr/lib64/python2.7/imputil.pyRŮs  #  %  tctos.pycCsét|dƒjƒ}|r8|ddkr8|d}ntj||dƒ}yt|tdƒ}Wntk rwnnX|jdƒ|jtjd|ƒƒt j ||ƒ|j ƒ|j ddƒ|jt jƒƒ|jƒ|S( sNCompile (and cache) a Python source file. The file specified by is compiled to a code object and returned. Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modification timestamp must be provided as a Long value. trUi˙˙˙˙s texectwbts|D]6\}}|rM|G|jjddƒGHq |GdGHq WdS(NR$s-- no importers-- non-existent module(R(R)titemstsortR.R/(RŽRDR9((s/usr/lib64/python2.7/imputil.pyt_print_importersfs  cCs'tƒjƒtjjdtƒƒdS(Ni(RRR(R@tinsertR(((s/usr/lib64/python2.7/imputil.pyt _test_revampos ((((RItwarningsRRR(RJRsRuR^RšRARRRt __debug__RpRŚRRRRŒRR‘R”RRRRR°R˛(((s/usr/lib64/python2.7/imputil.pyt s4       ťÁ    $  6