config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/ihooks.pyc

³ò
h”Rc@sZdZddkZddkZddkZddkZddddddd	d
gZdZddklZlZl	Z	dd
kl
Z
lZlZe
Z
eZddd„ƒ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().

iÿÿÿÿNtBasicModuleLoadertHookstModuleLoadertFancyModuleLoadertBasicModuleImportertModuleImportertinstallt	uninstalli(tC_EXTENSIONt	PY_SOURCEtPY_COMPILED(t	C_BUILTINt	PY_FROZENt
PKG_DIRECTORYt_VerbosecBs8eZed„Zd„Zd„Zd„Zd„ZRS(cCs
||_dS(N(tverbose(tselfR((s"/usr/local/lib/python2.5/ihooks.pyt__init__IscCs|iS(N(R(R((s"/usr/local/lib/python2.5/ihooks.pytget_verboseLscCs
||_dS(N(R(RR((s"/usr/local/lib/python2.5/ihooks.pytset_verboseOscGs|io|i|ŒndS(N(Rtmessage(Rtargs((s"/usr/local/lib/python2.5/ihooks.pytnoteTs
cGs|o
||GHn|GHdS(N((RtformatR((s"/usr/local/lib/python2.5/ihooks.pyRXs
(t__name__t
__module__tVERBOSERRRRR(((s"/usr/local/lib/python2.5/ihooks.pyRGs
			cBs>eZdZdd„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(tNonetdefault_pathtfind_module_in_dir(Rtnametpathtdirtstuff((s"/usr/local/lib/python2.5/ihooks.pytfind_moduleps
cCstiS(N(tsysR(R((s"/usr/local/lib/python2.5/ihooks.pyRxscCsS|djo|i|ƒSn2yti||gƒSWntj
odSnXdS(N(Rtfind_builtin_moduletimpR"tImportError(RRR ((s"/usr/local/lib/python2.5/ihooks.pyR{s
cCsXti|ƒoddddtffSnti|ƒoddddtffSndS(Nt(R%t
is_builtinRtBUILTIN_MODULEt	is_frozent
FROZEN_MODULE(RR((s"/usr/local/lib/python2.5/ihooks.pyR$„s
cCsF|\}}}zti||||ƒSWd|o|iƒnXdS(N(R%tload_moduletclose(RRR!tfiletfilenametinfo((s"/usr/local/lib/python2.5/ihooks.pyR,Œs
N(	RRt__doc__RR"RRR$R,(((s"/usr/local/lib/python2.5/ihooks.pyR_s				cBsøeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	dd„Zdd	„Zdd
„Z
dd„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((s"/usr/local/lib/python2.5/ihooks.pyR2 scCs
ti|ƒS(N(R%t
new_module(RR((s"/usr/local/lib/python2.5/ihooks.pyR3¡scCs
ti|ƒS(N(R%R((RR((s"/usr/local/lib/python2.5/ihooks.pyR(¢scCs
ti|ƒS(N(R%tinit_builtin(RR((s"/usr/local/lib/python2.5/ihooks.pyR4£scCs
ti|ƒS(N(R%R*(RR((s"/usr/local/lib/python2.5/ihooks.pyR*¤scCs
ti|ƒS(N(R%tinit_frozen(RR((s"/usr/local/lib/python2.5/ihooks.pyR5¥scCs
ti|ƒS(N(R%tget_frozen_object(RR((s"/usr/local/lib/python2.5/ihooks.pyR6¦scCsti|||ƒS(N(R%tload_source(RRR/R.((s"/usr/local/lib/python2.5/ihooks.pyR7§scCsti|||ƒS(N(R%t
load_compiled(RRR/R.((s"/usr/local/lib/python2.5/ihooks.pyR8©scCsti|||ƒS(N(R%tload_dynamic(RRR/R.((s"/usr/local/lib/python2.5/ihooks.pyR9«scCsti|||ddtfƒS(NR'(R%R,R
(RRR/R.((s"/usr/local/lib/python2.5/ihooks.pytload_package­scCs@|iƒ}||jo||Sn|i|ƒ||<}|S(N(tmodules_dictR3(RRtdtm((s"/usr/local/lib/python2.5/ihooks.pyt
add_module°s

cCstiS(N(R#tmodules(R((s"/usr/local/lib/python2.5/ihooks.pyR;·scCstiS(N(R#R(R((s"/usr/local/lib/python2.5/ihooks.pyR¸scCstii|ƒS(N(tosRtsplit(Rtx((s"/usr/local/lib/python2.5/ihooks.pyt
path_splitºscCstii||ƒS(N(R@Rtjoin(RRBty((s"/usr/local/lib/python2.5/ihooks.pyt	path_join»scCstii|ƒS(N(R@Rtisabs(RRB((s"/usr/local/lib/python2.5/ihooks.pyt
path_isabs¼scCstii|ƒS(N(R@Rtexists(RRB((s"/usr/local/lib/python2.5/ihooks.pytpath_exists¿scCstii|ƒS(N(R@Rtisdir(RRB((s"/usr/local/lib/python2.5/ihooks.pyt
path_isdirÀscCstii|ƒS(N(R@Rtisfile(RRB((s"/usr/local/lib/python2.5/ihooks.pytpath_isfileÁscCstii|ƒS(N(R@Rtislink(RRB((s"/usr/local/lib/python2.5/ihooks.pytpath_islinkÂscGs
t|ŒS(N(topen(RRB((s"/usr/local/lib/python2.5/ihooks.pytopenfileÅscCs
ti|ƒS(N(R@tlistdir(RRB((s"/usr/local/lib/python2.5/ihooks.pyRSÇsN( RRR1R2R3R(R4R*R5R6RR7R8R9R:R>R;RRCRFRHRJRLRNRPRRtIOErrortopenfile_errorRSR@terrort
listdir_error(((s"/usr/local/lib/python2.5/ihooks.pyR”s4																				cBs_eZdZd
ed„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(RRRthooks(RRXR((s"/usr/local/lib/python2.5/ihooks.pyRÖscCs
|iiƒS(N(RXR(R((s"/usr/local/lib/python2.5/ihooks.pyRÚscCs
|iiƒS(N(RXR;(R((s"/usr/local/lib/python2.5/ihooks.pyR;ÝscCs|iS(N(RX(R((s"/usr/local/lib/python2.5/ihooks.pyt	get_hooksàscCs
||_dS(N(RX(RRX((s"/usr/local/lib/python2.5/ihooks.pyt	set_hooksãscCs^|ii|ƒoddddtffSn|ii|ƒoddddtffSndS(NR'(RXR(RR)R*R+(RR((s"/usr/local/lib/python2.5/ihooks.pyR$æs
icCs2|djo|i|ƒSn|o…|ii||ƒ}|ii|ƒoY|id|dƒ}|o9|d}|o|iƒnd|ddtffSq¦qªnx|iiƒD]p}|\}}	}
|ii|||ƒ}y&|ii	||	ƒ}|||fSWqº|ii
j
oqºXqºWdS(NRiR'(RR$RXRFRLRR-R
R2RRRU(RRR tallow_packagestfullnameR!R.R0tsufftmodettypetfp((s"/usr/local/lib/python2.5/ihooks.pyRîs*

"	c
CsA|\}}}|\}}}zý|tjo|ii|ƒSn|tjo|ii|ƒSn|tjo|ii|||ƒ}	n|tjo|ii|||ƒ}	nf|t	jo|ii
|||ƒ}	n=|tjo|ii|||ƒ}	nt
d||f‚Wd|o|iƒnX||	_|	S(Ns$Unrecognized module type (%r) for %s(R)RXR4R+R5RR9R	R7R
R8R
R:R&R-t__file__(
RRR!R.R/R0R]R^R_R=((s"/usr/local/lib/python2.5/ihooks.pyR,s*





	N(
RRR1RRRRR;RYRZR$RR,(((s"/usr/local/lib/python2.5/ihooks.pyRÌs					cBseZdZd„ZRS(s8Fancy module loader -- parses and execs the code itself.cBsî|\}}\}}}|}d}	|ejo©|id|dƒ}
|
ped|‚n|
\}}}
|
\}}}|eefjo,|o|iƒned||f‚n|g}	|}|}|}n|ejo|ii	|ƒ}n||ejo,ddk
}|idƒ|i|ƒ}nC|ejo"|i
ƒ}e||dƒ}nei|||ƒS|ii|ƒ}|	o
|	|_n||_y||iUWn1|iiƒ}||jo||=n‚nX|S(NRis No __init__ module in package %ss/Bad type (%r) for __init__ module in package %siÿÿÿÿitexec(RR
RR&R
R	R-R+RXR6tmarshaltseektloadtreadtcompileRR,R>t__path__Rat__dict__R;(RRR!R.R/R]R^R_trealfilenameRt	initstufftinitfiletinitfilenametinitinfotinitsufftinitmodetinittypetcodeRctdataR=R<((s"/usr/local/lib/python2.5/ihooks.pyR, sR
	





	
(RRR1R,(((s"/usr/local/lib/python2.5/ihooks.pyRscBszeZdZded„Zd„Zd„Zd„Zd„Z	hhgd„Z
dd„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(RRRRtloaderR;R?(RRtR((s"/usr/local/lib/python2.5/ihooks.pyRWscCs|iS(N(Rt(R((s"/usr/local/lib/python2.5/ihooks.pyt
get_loader\scCs
||_dS(N(Rt(RRt((s"/usr/local/lib/python2.5/ihooks.pyt
set_loader_scCs
|iiƒS(N(RtRY(R((s"/usr/local/lib/python2.5/ihooks.pyRYbscCs|ii|ƒS(N(RtRZ(RRX((s"/usr/local/lib/python2.5/ihooks.pyRZescCsht|ƒ}||ijo|i|Sn|ii|ƒ}|ptd|‚n|ii||ƒS(NsNo module named %s(tstrR?RtR"R&R,(RRtglobalstlocalstfromlistR!((s"/usr/local/lib/python2.5/ihooks.pyt
import_modulehscCsOt|iƒ}|ii||ƒ}|ptd|‚n|ii||ƒS(NsModule %s not found for reload(RwRRtR"R&R,(RtmoduleRRR!((s"/usr/local/lib/python2.5/ihooks.pytreloadqs
cCs|it|iƒ=dS(N(R?RwR(RR|((s"/usr/local/lib/python2.5/ihooks.pytunloadxscCsiti|_ti|_ttdƒp
dt_nti|_|i	t_|it_|it_dS(NR~(
t__builtin__t
__import__tsave_import_moduleR}tsave_reloadthasattrRR~tsave_unloadR{(R((s"/usr/local/lib/python2.5/ihooks.pyR|s
cCs<|it_|it_|it_tip
t`ndS(N(RRR€R‚R}R„R~(R((s"/usr/local/lib/python2.5/ihooks.pyR†s

N(RRR1RRRRuRvRYRZR{R}R~RR(((s"/usr/local/lib/python2.5/ihooks.pyROs							
cBs\eZdZd	d	d	d„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(NRh(tdetermine_parenttfind_head_packageRwt	load_tailRƒtensure_fromlist(	RRRxRyRztparenttqttailR=((s"/usr/local/lib/python2.5/ihooks.pyR{’scCs¶|p
d|jodSn|d}d|jo,|i|}||ijpt‚|Snd|joE|idƒ}|| }|i|}|i|jpt‚|SndS(NRRht.(RR?RitAssertionErrortrfindR(RRxtpnameR‰ti((s"/usr/local/lib/python2.5/ihooks.pyR…œs





cCsäd|jo+|idƒ}|| }||d}n
|}d}|od|i|f}n|}|i|||ƒ}|o||fSn|o:|}d}|i|||ƒ}|o||fSqÓntd|‚dS(NRŒiR's%s.%ssNo module named (tfindRt	import_itRR&(RR‰RRtheadR‹tqnameRŠ((s"/usr/local/lib/python2.5/ihooks.pyR†¬s&

cCsž|}x‘|o‰|idƒ}|djot|ƒ}n|| ||d}}d|i|f}|i|||ƒ}|ptd|‚q	q	W|S(NRŒiis%s.%ssNo module named (R‘tlenRR’R&(RRŠR‹R=RR“tmname((s"/usr/local/lib/python2.5/ihooks.pyR‡Á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 (t__all__tAttributeErrorRˆRƒRR’R&(RR=Rzt	recursivetsubtalltsubnametsubmod((s"/usr/local/lib/python2.5/ihooks.pyRˆÍs

c
Csâ|p
td‚n|p)y|i|SWqDtj
oqDXny|o|i}Wntj
odSnXt|ƒ}|ii||ƒ}|pdSnt|ƒ}|ii	||ƒ}|ot
|||ƒn|S(NsEmpty module name(t
ValueErrorR?tKeyErrorRhR™RRwRtR"R,tsetattr(RtpartnametfqnameR‰t
force_loadRR!R=((s"/usr/local/lib/python2.5/ihooks.pyR’Þs(
		cCs€t|iƒ}d|jo|i||dddƒSn|idƒ}|| }|i|}|i||d||ddƒS(NRŒR¤i(RwRR’RRŽR?(RR|RRRR‰((s"/usr/local/lib/python2.5/ihooks.pyR}ôs


N(RRR1RR{R…R†R‡RˆR’R}(((s"/usr/local/lib/python2.5/ihooks.pyRŽs
			cCs%|ptptƒatiƒdS(N(tdefault_importerRtcurrent_importerR(timporter((s"/usr/local/lib/python2.5/ihooks.pyRscCstiƒdS(N(R¦R(((s"/usr/local/lib/python2.5/ihooks.pyRs((R1RR%R@R#R˜RRR	R
RRR
R)R+RRRRRRRRR¥R¦RR(((s"/usr/local/lib/python2.5/ihooks.pys<module>3s,58P3?p

Man Man