ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/imputil.pyo

Ñò
oÄMc	@s\dZddklZedddƒ[ddkZddkZddkZddkZddkZddd	gZe	d
ƒZ
e	eƒZddd„ƒYZddd„ƒYZ
eod
pdZdeZd„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„Zd„Zd„Z
d„ZRS(
sManage the import process.cCsGt|tƒot|ƒ}n|d|_||_|i|d<dS(s8Install this ImportManager into the specified namespace.t
__import__N(t
isinstancet_ModuleTypetvarstprevious_importert	namespacet_import_hook(tselfR((s/usr/lib/python2.6/imputil.pytinstall!s

	cCs|i|id<dS(s&Restore the previous import mechanism.RN(R
R(R
((s/usr/lib/python2.6/imputil.pyt	uninstall1scCs|ii||ƒdS(N(tfs_impt
add_suffix(R
tsuffixt
importFunc((s/usr/lib/python2.6/imputil.pyR5scCs¥tptƒn|djo|ipt}|ƒ}n||_xItiƒD];}|dtijo!|i	|dt
|ƒiƒqRqRW|i	dtƒdS(Niis.py(
t_os_statt
_os_bootstraptNonetclsFilesystemImportert_FilesystemImporterRtimptget_suffixestC_EXTENSIONRtDynLoadSuffixImportertimport_filetpy_suffix_importer(R
Rtclstdesc((s/usr/lib/python2.6/imputil.pyt__init__@s

	

c
Csh|idƒ}|i|ƒ}|o(|ii|||ƒ}|o|Snyti|d}Wn>tj
o2|i|dƒ}|ptd|‚q£nXt	|ƒdjo(|p|S|i
idƒp|Sn|i
idƒ}	|	o|	i||d|ƒSt	|ƒdjo5t
||dƒo!|ot||dƒS|Sntd|‚dS(	s5Python calls this hook to locate and import a module.t.isNo module named it	__ispkg__t__importer__iN(tsplitt_determine_import_contextR$t
_do_importtsystmodulestKeyErrort_import_top_moduletImportErrortlent__dict__tgett_finish_importthasattrtgetattr(
R
tfqnametglobalstlocalstfromlisttpartstparenttmodulet
top_moduletimporter((s/usr/lib/python2.6/imputil.pyRVs2		'cCs|p|idƒodS|d}|doti|}|S|idƒ}|djodS|| }ti|}|S(sJReturns the context in which a module should be imported.

        The context could be a loaded (package) module and the imported module
        will be looked for within that package. The context could also be None,
        meaning there is no context -- the module should be looked for as a
        "top-level" module.
        R$t__name__R#R"iÿÿÿÿN(R/RR(R)trfind(R
R4t
parent_fqnameR8ti((s/usr/lib/python2.6/imputil.pyR&•s	




cCs\xUtiD]J}t|tƒo|ii||ƒ}n|i|ƒ}|o|Sq
WdS(N(R(tpathRt_StringTypeRtimport_from_dirt
import_topR(R
tnametitemR9((s/usr/lib/python2.6/imputil.pyR+¼s
	cCs*|iidƒ}|pntd‚dS(s*Python calls this hook to reload a module.R$sreload not yet implementedN(R.R/tSystemError(R
R9R;((s/usr/lib/python2.6/imputil.pyt_reload_hookÈsN(R<t
__module__t__doc__R	t__builtin__RRRRRR!RR&R+RG(((s/usr/lib/python2.6/imputil.pyRs			?	'	cBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	s3Base class for replacing standard import functions.cCs|id||ƒS(sImport a top-level module.N(t_import_oneR(R
RD((s/usr/lib/python2.6/imputil.pyRCÜscCs@|i||ƒ}|p|S|io|i||ƒn|S(N(t
_load_tailR#t_import_fromlist(R
ttopR7R6tbottom((s/usr/lib/python2.6/imputil.pyR0äs
cCs}yti|SWntj
onX|i|||ƒ}|djodS|i||ƒ}|ot|||ƒn|S(sImport a single module.N(R(R)R*tget_codeRt_process_resulttsetattr(R
R8tmodnameR3tresultR9((s/usr/lib/python2.6/imputil.pyRKs
cBsÌ|\}}}e|eƒ}|o
|}nei|ƒ}||_||_|ii|ƒ|ei	|<|p>y||iUWq²|ei	joei	|=n‚q²Xnei	|}||_
|S(N(RRRt
new_moduleR$R#R.tupdateR(R)R<(R
t.1R3tispkgtcodetvaluest	is_moduleR9((s/usr/lib/python2.6/imputil.pyRQs&
		

	cCsUxN|D]F}d|i|f}|i|||ƒ}|ptd|‚qqW|S(sˆImport the rest of the modules, down from the top-level module.

        Returns the last module in the dotted list of modules.
        s%s.%ssNo module named (R<RKR,(R
tmR7tpartR3((s/usr/lib/python2.6/imputil.pyRL@scCs­d|jo)t|ƒt|iidgƒƒ}nxp|D]h}|djoUt||ƒoDd|i|f}|i|||ƒ}|ptd|‚q¥q=q=WdS(s*Import any sub-modules in the "from" list.t*t__all__s%s.%sscannot import name N(tlistR.R/R1R<RKR,(R
tpackageR6tsubtsubnametsubmod((s/usr/lib/python2.6/imputil.pyRMLs
	 cCsS|d}|id|}|i|||ƒ}|pdS|i||d|ƒS(s¨Attempt to import the module relative to parent.

        This method is used when the import context specifies that <self>
        imported the parent module.
        iR"iN(R<RKRR0(R
R8R7R6ttop_namet
top_fqnameR:((s/usr/lib/python2.6/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/lib/python2.6/imputil.pyRPqs(R<RHRIRCR0RKRQRLRMR'RP(((s/usr/lib/python2.6/imputil.pyRÙs		#		$			tctos.pycCsît|dƒiƒ}|o|ddjo|d}nti||dƒ}yt|tdƒ}Wntj
onoX|idƒ|itid|ƒƒt	i
||ƒ|iƒ|iddƒ|it
iƒƒ|iƒ|S(	sNCompile (and cache) a Python source file.

    The file specified by <pathname> 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<Ii(topentreadRJtcompilet_suffix_chartIOErrortwritetstructtpacktmarshaltdumptflushtseekRt	get_magictclose(tpathnamet	timestampt
codestringRYtf((s/usr/lib/python2.6/imputil.pyt_compiležs 



cCsti}d
}d|jod}ddkl}n©d|jod}ddkl}n‚d|jod}ddkl}n[d|jod}ddkl}n4d	|joddkl}d
„}n
t	d‚|d
jo|d„}n|a
|ad
S(sISet up 'os' module replacement functions for use during import bootstrap.tposixt/iÿÿÿÿ(tstattnts\tdostos2tmaccSsT|djo|Sd|jod|}n|ddjo|d}n||S(NRt:iÿÿÿÿ((tatb((s/usr/lib/python2.6/imputil.pytjoinÒs

sno os specific module foundcSsK|djo|S|d}|djp
||jo	||S|||S(NRiÿÿÿÿR‚((R‰RŠtseptlastchar((s/usr/lib/python2.6/imputil.pyR‹Þs

	N(R(tbuiltin_module_namesRRRƒR„R…R†R‡R,Rt
_os_path_join(tnamesR‹RŒRƒ((s/usr/lib/python2.6/imputil.pyR¾s,	





		
	cCs8yt|ƒ}Wntj
odSX|id@djS(s&Local replacement for os.path.isdir().iði@N(RtOSErrorRtst_mode(R|ts((s/usr/lib/python2.6/imputil.pyt_os_path_isdirìs
cCs4yt|ƒ}Wntj
odSXt|iƒS(s,Return the file modification time as a Long.N(RR‘Rtlongtst_mtime(R|R“((s/usr/lib/python2.6/imputil.pyt
_timestampôs
cBseZd„ZRS(cCsx|odSti|ƒo
ti}n"ti|ƒo
ti}ndSti|d|dd|fƒ}d|hfS(NRi(RRt
is_builtint	C_BUILTINt	is_frozent	PY_FROZENtload_module(R
R8RSR3ttypeR9((s/usr/lib/python2.6/imputil.pyRPs

!(R<RHRP(((s/usr/lib/python2.6/imputil.pyRsRcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs
g|_dS(N(tsuffixes(R
((s/usr/lib/python2.6/imputil.pyR!scCs|ii||fƒdS(N(Ržtappend(R
RR((s/usr/lib/python2.6/imputil.pyRscCs7|it||ƒ|ƒ}|o|i||ƒSdS(N(t_import_pathnameRRQR(R
tdirR3RT((s/usr/lib/python2.6/imputil.pyRB!scCs]x>|iD]3}|it||ƒ|ƒ}|dj	o|Sq
W|it|i|ƒ|ƒS(N(t__path__R RRt
__pkgdir__(R
R8RSR3tsubmodule_pathRY((s/usr/lib/python2.6/imputil.pyRP's

	c	CsÅt|ƒoZ|it|dƒ|ƒ}|o3|d}||d<|g|d<d|d|fSdSxW|iD]L\}}||}yt|ƒ}Wntj
oqqX||||ƒSqqWdS(NR!iR£R¢i(R”R RRRžRR‘(	R
R|R3RTRZRRtfilenametfinfo((s/usr/lib/python2.6/imputil.pyR 5s$
	




(R<RHR!RRBRPR (((s/usr/lib/python2.6/imputil.pyRs
				c	Cs|d t}t|dƒ}t|ƒ}d}|dj	o‰||jo|t|dƒ}|idƒtiƒjoCti	d|idƒƒd}||jot
i|ƒ}q¸n|iƒn|djo|}t
||ƒ}nd|h|d6fS(Niýÿÿÿitrbis<Iit__file__(t_suffixR•R—RRnRoRRzRttunpackRvtloadR{R€(	R¥R¦R3tfilett_pytt_pycRYRtt((s/usr/lib/python2.6/imputil.pyROs

RcBseZd„Zd„ZRS(cCs
||_dS(N(R (R
R ((s/usr/lib/python2.6/imputil.pyR!cscCsGt||idƒ}ti||||iƒ}||_d|hfS(Nii(RnR RRœR¨(R
R¥R¦R3tfpR9((s/usr/lib/python2.6/imputil.pyRfs	(R<RHR!R(((s/usr/lib/python2.6/imputil.pyRbs	cCs`tiiƒ}|iƒx@|D]8\}}|o|G|iiddƒGHq |GdGHq WdS(NR$s-- no importers-- non-existent module(R(R)titemstsortR.R/(R±RDR9((s/usr/lib/python2.6/imputil.pyt_print_importersos
cCs'tƒiƒtiidtƒƒdS(Ni(RRR(R@tinsertR(((s/usr/lib/python2.6/imputil.pyt_test_revampxs
((((RItwarningsRRR(RJRtRvR_RRARRRt	__debug__RqR©R€RRRRR”R—RRRRR³Rµ(((s/usr/lib/python2.6/imputil.pyt<module>s4»À
	
	.		
6	
		

ACC SHELL 2018