MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.4/site-packages/mx/Misc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/mx/Misc/PackageTools.pyc
m
<c@sdZdZdkZdkZdkZdkZdkZdkZdkZdk	Z
eeidZ
eideie
ddZeideie
ddZeiddddeiieiieiieieed	Zeieieiid
ZdeiedZdd
deeedZ de edZ!ddd
deedZ"ddd
de"edZ#e$dZ%dZ&ddei'e(dZ)dei*e(dZ+dS(so PackageTools - A set of tools to aid working with packages.

    XXX Still needs some more testing...

    Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2001, eGenix.com Software GmbH; mailto:info@egenix.com
    See the documentation for further information on copyrights,
    or contact the author. All Rights Reserved.
s0.2.2Nis(.*)(t|s)$s	__init__(tc
Cs}||}|djo
g}n|o_xL|D]P}
|	i|
}|o4|i
ddjo|i||i
dq1q1Wnx|D]}
|||
}||oyxti|D]a}|
i|}|oE|i||
|o(t|ddd||
dd|nPqqWq|	i|
}|o4|i
ddjo|i||i
dqqW|S(s3 Return a list of package names found in dir.

        Packages are Python modules and subdirectories that provide an
        __init__ module.  The .py extension is removed from the
        files. The __init__ modules are not considered being seperate
        packages.

        If files_only is true, only Python files are included in the
        search (subdirectories are *not* taken into account). If
        recursive is true the search recurses into package
        directories.

        pkgbasename and pkglist are only used during recursion.
        
    it__init__t	recursivetpkgbasenamet.tpkglistN(tlistdirtdirtlRtNonet
files_onlytfilenametmodule_nametmatchtmtgrouptappendRtjointpathtisdirtostfiletinitmodule_nameRt
find_packages(RRRRRRtexistsRRR
RRR	RRR((t8/usr/lib/python2.4/site-packages/mx/Misc/PackageTools.pyRs:

&

"cCs~yt|i}Wn,ttfj
ot|id}nX|id}x(t
|D]\}}||||<q\W|S(sF Assuming that package points to a loaded package module, this
        function tries to identify all subpackages of that package.

        Subpackages are all Python files included in the same
        directory as the module plus all subdirectories having an
        __init__.py file.  The modules name is prepended to all
        subpackage names.

        The module location is found by looking at the __file__
        attribute that non-builtin modules define. The function uses
        the __all__ attribute from the package __init__ module if
        available.
        
    iRN(
tlisttpackaget__all__tsubpackagestImportErrortAttributeErrorRt__path__t__name__tbasenametirangetitname(RtsplitRt	splitpathRR&R#R%((Rtfind_subpackagesGs

icCsayddWn7|di}x!||D]}|i}q/WnX|id}~t	i
|S(s Returns the module object that the callee is calling from.

        upcount can be given to indicate how far up the execution
        stack the function is supposed to look (1 == direct callee, 2
        == callee of callee, etc.).

    iiiR"N(texc_infottb_frametframettrangetupcountR%tf_backt	f_globalsR&tsystmodules(R.R*R-R&R%R,((Rt_thismodulefs


tstrictc
Cs|djotd}n|i}
ti}	x|D]}|	i
|p
d}nd}y;|||
|
dg}|o|o||}nWnLtj
o@}|djoq6q|djo
t|qtdnX||
|<q6WdS(	s Import all modules given in modnames into module.

        module defaults to the callees module. modnames may contain
        dotted package names.

        If errors is 'strict' (default), then ImportErrors are
        raised. If set to 'ignore', they are silently ignored.

        If reload is true (default is false), all already modules
        among the list will be forced to reload.
        
    iiit*tignoreR4sunkown errors valueN(tmoduleR
R3t__dict__tlocalsR1R2tsysmodstmodnamesR&thas_keytis_newtimportertmodtreloadtreloaderRtwhyterrorst
ValueError(
R;R7RCR@t
thismoduleR>RAR&R=R:R9RBR?((Rtimport_modules{s*
		



cCs||||d|dS(s Does a subpackages scan using find_subpackages(module) and then
        imports all submodules found into module.

        The module location is found by looking at the __file__
        attribute that non-builtin modules define. The function uses
        the __all__ attribute from the package __init__ module if
        available.

        If reload is true (default is false), all already modules
        among the list will be forced to reload.
        
    R@N(RFR)R7R@(R7R@RFR)((Rtimport_subpackagesscCsg}|i}
ti}x|D]}|i|p
d}	nd}	y;||||dg}
|o|	o||
}
nWnLt
j
o@}|djoqq|djo
t
|qtdnX|
|
qW|S(sv Imports all modules in modnames using the given namespaces and returns
        list of corresponding module objects.

        If errors is 'strict' (default), then ImportErrors are
        raised. If set to 'ignore', they are silently ignored.

        If reload is true (default is false), all already modules
        among the list will be forced to reload.
        
    iiR5R6R4sunkown errors valueN(R2RR1R:R;R&R<R=R>R9R?R@RARRBRCRD(R;R9tglobalsRCR@R>RAR&R2R=RR:RBR?((Rtload_moduless*
		



cCs"|||||d|d|S(s Same as import_subpackages but with load_modules
        functionality, i.e. imports the modules and also returns a list of
        module objects.

        If errors is 'strict' (default), then ImportErrors are
        raised. If set to 'ignore', they are silently ignored.

        If reload is true (default is false), all already modules
        among the list will be forced to reload.
        
    RCR@N(RIR)R7R9RHRCR@(R7R9RHRCR@RIR)((Rtload_subpackagesscCs|ti|S(sv Converts a list of module names into a list of module objects.
    
        The modules must already be loaded.

    N(textractR1R2tnames(RLRK((RR2scCsy|d}t|}ti|g}xLtiiD];\}}|| |jo|dj	o|i|q6q6W|S(s Returns a list of all modules belonging to the package with the
        given name.

        The package must already be loaded. Only the currently
        registered modules are included in the list.
        
    RN(tpkgnameRtlent	match_lenR1R2tmodstitemstktvR
R(RMRORPRRRSR((Rtpackage_moduless
c	Csg}x|D]}x|iiD]p\}}t||joQ|o|||oq#n|o|i|||fq|i|q#q#Wq
W|S(sY Find all subclasses of baseclass or simply all classes (if baseclass
        is None) defined by the module objects in list mods.

        If annotated is true the returned list will contain tuples
        (module_object,name,class_object) for each class found where
        module_object is the module where the class is defined.
        
    N(
tclassesRPR?R8RQR&tobjttypet	ClassTypet	baseclasst
issubclasst	annotatedR(	RPRYR[RXRZRVR&RUR?((Rtfind_classes	sc	Cs}g}xp|D]h}x_|iiD]N\}}t||o2|o|i
|||fqq|i
|q#q#Wq
W|S(s7 Find all instances of baseclass defined by the module objects
        in list mods.

        If annotated is true the returned list will contain tuples
        (module_object,name,instances_object) for each instances found where
        module_object is the module where the instances is defined.
        
    N(t	instancesRPR?R8RQR&RVt
isinstanceRYR[R(	RPRYR[tInstanceTypeRZRVR&R]R?((Rtfind_instances!s(,t__doc__t__version__RttypesR1tstringtretimpt__builtin__tmx.Tools.NewBuiltinstmxt
projectiontget_suffixestsuffixestcompileRR
RtcurdirR
RRRRRR'R)R*R-R3t
__import__R@RFRGRIRJRKR2RTRXRZR\R_R`(R3RRgRFRJReRTR`R)RGRfRbRdR1R\RIRRcR2R
RRiRl((Rt?	s"?	##B3($	

Anon7 - 2021