KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/22697/root/usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/22697/root/usr/lib64/python2.4/ihooks.pyc
mς
‚=5Dc@sHdZdkZdkZdkZdkZdddddddd	gZd
ZdklZlZl	Z	dkl
Z
lZlZe
Z
eZd
fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdZdadd„Zd„ZdS(s,	Import hook support.

Consistent use of this module will make it possible to change the
different mechanisms involved in loading modules independently.

While the built-in module imp exports interfaces to the built-in
module searching and loading algorithm, and it is possible to replace
the built-in function __import__ in order to change the semantics of
the import statement, until now it has been difficult to combine the
effect of different __import__ hacks, like loading modules from URLs
by rimport.py, or restricted execution by rexec.py.

This module defines three new concepts:

1) A "file system hooks" class provides an interface to a filesystem.

One hooks class is defined (Hooks), which uses the interface provided
by standard modules os and os.path.  It should be used as the base
class for other hooks classes.

2) A "module loader" class provides an interface to search for a
module in a search path and to load it.  It defines a method which
searches for a module in a single directory; by overriding this method
one can redefine the details of the search.  If the directory is None,
built-in and frozen modules are searched instead.

Two module loader class are defined, both implementing the search
strategy used by the built-in __import__ function: ModuleLoader uses
the imp module's find_module interface, while HookableModuleLoader
uses a file system hooks class to interact with the file system.  Both
use the imp module's load_* interfaces to actually load the module.

3) A "module importer" class provides an interface to import a
module, as well as interfaces to reload and unload a module.  It also
provides interfaces to install and uninstall itself instead of the
default __import__ and reload (and unload) functions.

One module importer class is defined (ModuleImporter), which uses a
module loader instance passed in (by default HookableModuleLoader is
instantiated).

The classes defined here should be used as base classes for extended
functionality along those lines.

If a module importer class supports dotted names, its import_module()
must return a different value depending on whether it is called on
behalf of a "from ... import ..." statement or not.  (This is caused
by the way the __import__ hook is used by the Python interpreter.)  It
would also do wise to install a different version of reload().

NtBasicModuleLoadertHookstModuleLoadertFancyModuleLoadertBasicModuleImportertModuleImportertinstallt	uninstalli(sC_EXTENSIONs	PY_SOURCEsPY_COMPILED(s	C_BUILTINs	PY_FROZENs
PKG_DIRECTORYt_VerbosecBs8tZed„Zd„Zd„Zd„Zd„ZRS(NcCs
||_dS(N(tverbosetself(R
R	((t/usr/lib64/python2.4/ihooks.pyt__init__IscCs|iS(N(R
R	(R
((Rtget_verboseLscCs
||_dS(N(R	R
(R
R	((Rtset_verboseOscGs|io|i|ŒndS(N(R
R	tmessagetargs(R
R((RtnoteTs
cGs|o
||GHn|GHdS(N(Rtformat(R
RR((RRXs
(t__name__t
__module__tVERBOSERR
RRR(((RRGs
			cBs>tZdZed„Zd„Zd„Zd„Zd„ZRS(s;Basic module loader.

    This provides the same functionality as built-in import.  It
    doesn't deal with checking sys.modules -- all it provides is
    find_module() and a load_module(), as well as find_module_in_dir()
    which searches just one directory, and can be overridden by a
    derived class to change the module search algorithm when the basic
    dependency on sys.path is unchanged.

    The interface is a little more convenient than imp's:
    find_module(name, [path]) returns None or 'stuff', and
    load_module(name, stuff) loads the module.

    cCsZ|djodg|iƒ}nx/|D]'}|i||ƒ}|o|Sq+q+WdS(N(tpathtNoneR
tdefault_pathtdirtfind_module_in_dirtnametstuff(R
RRRR((Rtfind_moduleps
cCstiS(N(tsysR(R
((RRxscCsS|djo|i|ƒSn2yti||gƒSWntj
odSnXdS(N(RRR
tfind_builtin_moduleRtimpRtImportError(R
RR((RR{s
cCsXti|ƒoddddtffSnti|ƒoddddtffSndS(Nt(R t
is_builtinRRtBUILTIN_MODULEt	is_frozent
FROZEN_MODULE(R
R((RR„s
cCsF|\}}}zti||||ƒSWd|o|iƒnXdS(N(RtfiletfilenametinfoR tload_moduleRtclose(R
RRR)R(R'((RR*Œs(	RRt__doc__RRRRRR*(((RR_s				cBsψtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	e
d„Ze
d	„Ze
d
„Z
e
d„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeZd„ZeiZRS(sίHooks into the filesystem and interpreter.

    By deriving a subclass you can redefine your filesystem interface,
    e.g. to merge it with the URL space.

    This base class behaves just like the native filesystem.

    cCs
tiƒS(N(R tget_suffixes(R
((RR- scCs
ti|ƒS(N(R t
new_moduleR(R
R((RR.‘scCs
ti|ƒS(N(R R#R(R
R((RR#’scCs
ti|ƒS(N(R tinit_builtinR(R
R((RR/£scCs
ti|ƒS(N(R R%R(R
R((RR%€scCs
ti|ƒS(N(R tinit_frozenR(R
R((RR0₯scCs
ti|ƒS(N(R tget_frozen_objectR(R
R((RR1¦scCsti|||ƒS(N(R tload_sourceRR(R'(R
RR(R'((RR2§scCsti|||ƒS(N(R t
load_compiledRR(R'(R
RR(R'((RR3©scCsti|||ƒS(N(R tload_dynamicRR(R'(R
RR(R'((RR4«scCsti|||ddtfƒS(NR"(R R*RR'R(t
PKG_DIRECTORY(R
RR(R'((Rtload_package­scCs@|iƒ}||jo||Sn|i|ƒ||<}|S(N(R
tmodules_dicttdRR.tm(R
RR9R8((Rt
add_module°s

cCstiS(N(Rtmodules(R
((RR7·scCstiS(N(RR(R
((RRΈscCstii|ƒS(N(tosRtsplittx(R
R>((Rt
path_splitΊscCstii||ƒS(N(R<RtjoinR>ty(R
R>RA((Rt	path_join»scCstii|ƒS(N(R<RtisabsR>(R
R>((Rt
path_isabsΌscCstii|ƒS(N(R<RtexistsR>(R
R>((Rtpath_existsΏscCstii|ƒS(N(R<RtisdirR>(R
R>((Rt
path_isdirΐscCstii|ƒS(N(R<RtisfileR>(R
R>((Rtpath_isfileΑscCstii|ƒS(N(R<RtislinkR>(R
R>((Rtpath_islinkΒscGs
t|ŒS(N(topenR>(R
R>((RtopenfileΕscCs
ti|ƒS(N(R<tlistdirR>(R
R>((RROΗs( RRR,R-R.R#R/R%R0R1RR2R3R4R6R:R7RR?RBRDRFRHRJRLRNtIOErrortopenfile_errorROR<terrort
listdir_error(((RR”s4																				cBs_tZdZeed„Zd„Zd„Zd„Zd„Z	d„Z
dd„Zd	„ZRS(
sχDefault module loader; uses file system hooks.

    By defining suitable hooks, you might be able to load modules from
    other sources than the file system, e.g. from compressed or
    encrypted files, tar files or (if you're brave!) URLs.

    cCs*ti||ƒ|p
t|ƒ|_dS(N(RRR
R	thooksR(R
RTR	((RRΦscCs
|iiƒS(N(R
RTR(R
((RRΪscCs
|iiƒS(N(R
RTR7(R
((RR7έscCs|iS(N(R
RT(R
((Rt	get_hooksΰscCs
||_dS(N(RTR
(R
RT((Rt	set_hooksγscCs^|ii|ƒoddddtffSn|ii|ƒoddddtffSndS(NR"(R
RTR#RRR$R%R&(R
R((RRζs
icCs2|djo|i|ƒSn|o…|ii||ƒ}
|ii	|
ƒoY|i
d|
dƒ}|o9|d}	|	o|	i
ƒnd|
ddtffSq¦qͺnx|iiƒD]p}|\}}}|ii|||ƒ}
y&|ii|
|ƒ}||
|fSWqΊ|iij
oqΊXqΊWdS(NRiR"(RRR
RRtallow_packagesRTRBtfullnameRHRRR'R+R5R-R)tsufftmodettypeRNtfpRQ(R
RRRWR)R\RYRRZR'RXR[((RRξs*

"	c
CsA|\}}}|\}}}	zύ|	tjo|i	i
|ƒSn|	tjo|i	i
|ƒSn|	tjo|i	i|||ƒ}n|	tjo|i	i|||ƒ}nf|	tjo|i	i|||ƒ}n=|	tjo|i	i|||ƒ}ntd|	|f‚Wd|o|iƒnX||_|S(Ns$Unrecognized module type (%r) for %s(RR'R(R)RYRZR[R$R
RTR/RR&R0tC_EXTENSIONR4R9t	PY_SOURCER2tPY_COMPILEDR3R5R6R!R+t__file__(
R
RRR)RYR9R(RZR'R[((RR*s*





	(
RRR,RRRRR7RURVRRR*(((RRΜs					cBstZdZd„ZRS(s8Fancy module loader -- parses and execs the code itself.cBsλ|\}}\}}}	|}d}|	e	jo©|id|dƒ}
|
pe
d|‚n|
\}}}|\}}}|eefjo,|o|iƒne
d||f‚n|g}|}|}|}	n|	ejo|ii|ƒ}ny|	ejo)dk}|idƒ|i|ƒ}nC|	ejo"|iƒ}
e!|
|dƒ}ne"i#|||ƒS|ii$|ƒ}|o
||_&n||_'y||i(UWn1|ii)ƒ}||jo||=n‚nX|S(NRis No __init__ module in package %ss/Bad type (%r) for __init__ module in package %sitexec(+RR'R(RYRZR[trealfilenameRRR5R
Rt	initstuffR!RtinitfiletinitfilenametinitinfotinitsufftinitmodetinittypeR_R^R+R&RTR1tcodetmarshaltseektloadtreadtdatatcompileRR*R:R9t__path__R`t__dict__R7R8(R
RRRjRYRhR'R(ReR[RcRfRRoR8RdRbR9RiRgRZRk((RR* sN
	


	


	
(RRR,R*(((RRscBsztZdZeed„Zd„Zd„Zd„Zd„Z	hhgd„Z
ed„Zd„Zd	„Z
d
„ZRS(ssBasic module importer; uses module loader.

    This provides basic import facilities but no package imports.

    cCs?ti||ƒ|p
td|ƒ|_|iiƒ|_dS(N(	RRR
R	tloaderRRR7R;(R
RsR	((RRWscCs|iS(N(R
Rs(R
((Rt
get_loader\scCs
||_dS(N(RsR
(R
Rs((Rt
set_loader_scCs
|iiƒS(N(R
RsRU(R
((RRUbscCs|ii|ƒS(N(R
RsRVRT(R
RT((RRVescCsht|ƒ}||ijo|i|Sn|ii|ƒ}|ptd|‚n|ii||ƒS(NsNo module named %s(	tstrRR
R;RsRRR!R*(R
RtglobalstlocalstfromlistR((Rt
import_modulehscCsOt|iƒ}|ii||ƒ}|pt	d|‚n|ii
||ƒS(NsModule %s not found for reload(RvtmoduleRRR
RsRRRR!R*(R
R{RRR((Rtreloadqs
cCs|it|iƒ=dS(N(R
R;RvR{R(R
R{((RtunloadxscCsiti|_ti|_ttdƒp
dt_nti|_	|i
t_|it_|it_dS(NR}(t__builtin__t
__import__R
tsave_import_moduleR|tsave_reloadthasattrRR}tsave_unloadRz(R
((RR|s
cCs<|it_|it_|it_tip
t`ndS(N(R
R€R~RRR|RƒR}(R
((RR†s

(RRR,RRRRtRuRURVRzR|R}RR(((RROs							
cBs\tZdZeeed„Zd„Zd„Zd„Zdd„Zdd„Z	d„Z
RS(	s)A module importer that supports packages.c	Csv|i|ƒ}|i|t|ƒƒ\}}|i	||ƒ}|p|Snt|dƒo|i
||ƒn|S(NRq(R
tdetermine_parentRwtparenttfind_head_packageRvRtqttailt	load_tailR9RyR‚tensure_fromlist(	R
RRwRxRyR…R9R‡Rˆ((RRz’scCsΆ|p
d|jodSn|d}d|jo,|i|}||ijpt‚|Snd|joE|idƒ}|| }|i|}|i
|jpt‚|SndS(NRRqt.(RwRtpnameR
R;R…RrtAssertionErrortrfindtiR(R
RwR…RRŒ((RR„œs





cCsδd|jo+|idƒ}|| }||d}n
|}d}|od|i|f}n|}|i	|||ƒ}|o||fSn|o:|}d}|i	|||ƒ}|o||fSqΣntd|‚dS(NR‹iR"s%s.%ssNo module named (
RtfindRtheadRˆR…RtqnameR
t	import_itR‡RR!(R
R…RR‘RR’R‡Rˆ((RR†¬s&

cCsž|}x‘|o‰|idƒ}|djot|ƒ}n|| ||d}}d|i|f}|i
|||ƒ}|ptd|‚q	q	W|S(NR‹iis%s.%ssNo module named (R‡R9RˆRRtlenR‘RtmnameR
R“R!(R
R‡RˆR‘RR•R9((RR‰Αs
icCsΜxΕ|D]½}|djoH|p:y
|i}Wntj
oq[X|i||dƒqqn|djoUt	||ƒoDd|i
|f}|i|||ƒ}|ptd|‚qΔqqWdS(Nt*is%s.%ssNo module named (Rytsubt	recursiveR9t__all__talltAttributeErrorR
RŠR‚RtsubnameR“tsubmodR!(R
R9RyR˜RšRœRR—((RRŠΝs

cCsβ|p
td‚n|p)y|i|SWqDtj
oqDXny|o|i}Wnt
j
odSnXt|ƒ}|i
i||ƒ}|pdSnt|ƒ}|i
i||ƒ}|ot|||ƒn|S(NsEmpty module name(tpartnamet
ValueErrort
force_loadR
R;tfqnametKeyErrorR…RqRR›RRvRsRRR*R9tsetattr(R
RžR‘R…R R9RR((RR“ήs(
		cCs€t|iƒ}d|jo|i||dddƒSn|idƒ}|| }|i
|}|i||d||ddƒS(NR‹R i(RvR{RRR
R“RRŽRRŒR;R…(R
R{RR…RRŒ((RR|τs


(RRR,RRzR„R†R‰RŠR“R|(((RRŽs
			cCs%|ptptƒatiƒdS(N(timportertdefault_importerRtcurrent_importerR(R€((RRscCstiƒdS(N(R¦R(((RRs(R,R~R R<RR™RR]R^R_t	C_BUILTINt	PY_FROZENR5R$R&RRRRRRRRR₯R¦RR(R~RR™R R₯R]RR§RR_RR5R¨RR^R&RR$RRRR<RR((Rt?3s*				58P3?p

Anon7 - 2021