Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
mx
/
Misc
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/mx/Misc/PackageTools.pyo
mò š<c�����������@���sÍ��d��Z��d�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k �Z �e�e�i�ƒ��d�ƒ�Z �e�i�d�e�i�e �d�ƒ�d�ƒ�Z�e�i�d�e�i�e �d�ƒ�d�ƒ�Z�e�i�d�d�d�d�e�i�i�e�i�i�e�i�i�e�i�e�e�d �„�Z�e�i�e�i�e�i�i�d �„�Z�d�e�i�e�d�„�Z�d�d �d�e�e�e�d�„�Z �d�e �e�d�„�Z!�d�d�d �d�e�e�d�„�Z"�d�d�d �d�e"�e�d�„�Z#�e$�d�„�Z%�d�„��Z&�d�d�e�i'�e(�d�„�Z)�d�e�i*�e(�d�„�Z+�d�S(���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. s���0.2.2Ni����s���(.*)(t���|s���)$s ���__init__(t����c������ ���C���s}��|�|��ƒ�}�|�d�j�o �g��}�n�|�o_�xL|�D]P�} �| �i�| �ƒ�}�|�o4�|�i �d�ƒ�d�j�o�|�i�|�|�i �d�ƒ�ƒ�q1�q1�Wnñ�xí�|�D]å�} �|�|��| �ƒ�}�|�|�ƒ�oy�xÀ�t�i��|�ƒ�D]a�}�| �i�|�ƒ�}�|�oE�|�i�|�| �ƒ�|�o(�t�|�d�d�d�|�| �d�d�|�ƒn�PqÂ�qÂ�Wq�| �i�| �ƒ�}�|�o4�|�i �d�ƒ�d�j�o�|�i�|�|�i �d�ƒ�ƒ�q�q�W|�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. i���t���__init__t ���recursivet���pkgbasenamet���.t���pkglistN(���t���listdirt���dirt���lR���t���Nonet ���files_onlyt���filenamet���module_namet���matcht���mt���groupt���appendR���t���joint���patht���isdirt���ost���filet���initmodule_nameR���t ���find_packages(���R���R���R���R���R���R���t���existsR���R���R ���R���R���R ���R���R���R���(����(����t8���/usr/lib/python2.4/site-packages/mx/Misc/PackageTools.pyR������s:����� �&� � "c���������C���s~���y�t��|��i�ƒ�}�Wn,�t�t�f�j �o�t�|��i�d�ƒ�}�n�X|��i�d�}�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. i����R���N( ���t���listt���packaget���__all__t���subpackagest���ImportErrort���AttributeErrorR���t���__path__t���__name__t���basenamet���iranget���it���name(���R���t���splitR���t ���splitpathR���R&���R#���R%���(����(����R���t���find_subpackagesG���s����� �i���c���������C���sa���y�d�d�Wn7�|�ƒ��d�i�}�x!�|�|��ƒ�D]�}�|�i�}�q/�Wn�X|�i�d�}�~�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.). i���i����i���R"���N(���t���exc_infot���tb_framet���framet���tranget���upcountR%���t���f_backt ���f_globalsR&���t���syst���modules(���R.���R*���R-���R&���R%���R,���(����(����R���t���_thismodulef���s���� � � t���strictc��� ������C���sø���|�d�j�o�t�d�ƒ�}�n�|�i�} �t�i�} �xÂ�|��D]º�}�| �i �|�ƒ�p �d�}�n�d�}�y;�|�|�| �| �d�g�ƒ�}�|�o�|�o�|�|�ƒ�}�n�WnL�t�j �o@�}�|�d�j�o�q6�qæ�|�d�j�o �t�|�‚�qæ�t�d�‚�n�X|�| �|�<q6�Wd�S( ���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. i���i���i����t���*t���ignoreR4���s���unkown errors valueN(���t���moduleR ���R3���t���__dict__t���localsR1���R2���t���sysmodst���modnamesR&���t���has_keyt���is_newt���importert���modt���reloadt���reloaderR���t���whyt���errorst ���ValueError( ���R;���R7���RC���R@���t ���thismoduleR>���RA���R&���R=���R:���R9���RB���R?���(����(����R���t���import_modules{���s*����� � c���������C���s���|�|�|��ƒ�|��d�|�ƒd�S(���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(���RF���R)���R7���R@���(���R7���R@���RF���R)���(����(����R���t���import_subpackages£���s�����c���������C���sá���g��}�|�i�} �t�i��}�xÂ�|��D]º�}�|�i�|�ƒ�p �d�} �n�d�} �y;�|�|�|�|�d�g�ƒ�} �|�o�| �o�|�| �ƒ�} �n�WnL�t �j �o@�}�|�d�j�o�q�qÏ�|�d�j�o �t �|�‚�qÏ�t�d�‚�n�X| �| �ƒ�q�W|�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. i���i����R5���R6���R4���s���unkown errors valueN(���R2���R���R1���R:���R;���R&���R<���R=���R>���R9���R?���R@���RA���R���RB���RC���RD���(���R;���R9���t���globalsRC���R@���R>���RA���R&���R2���R=���R���R:���RB���R?���(����(����R���t���load_modules¶���s*���� � � c���������C���s"���|�|�|��ƒ�|�|�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. RC���R@���N(���RI���R)���R7���R9���RH���RC���R@���(���R7���R9���RH���RC���R@���RI���R)���(����(����R���t���load_subpackagesÚ���s�����c���������C���s���|�t�i�|��ƒ�S(���sv��� Converts a list of module names into a list of module objects. The modules must already be loaded. N(���t���extractR1���R2���t���names(���RL���RK���(����(����R���R2���í���s�����c���������C���sy���|��d�}�t�|�ƒ�}�t�i�|��g�}�xL�t�i�i�ƒ��D];�\�}�}�|�|� |�j�o�|�d�j �o�|�i�|�ƒ�q6�q6�W|�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. R���N(���t���pkgnameR���t���lent ���match_lenR1���R2���t���modst���itemst���kt���vR ���R���(���RM���RO���RP���RR���RS���R���(����(����R���t���package_modulesø���s����� �c��� ������C���sŸ���g��}�x’�|��D]Š�}�x�|�i�i�ƒ��D]p�\�}�}�t�|�ƒ�|�j�oQ�|�o�|�|�|�ƒ�o�q#�n�|�o�|�i�|�|�|�f�ƒ�q“�|�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( ���t���classesRP���R?���R8���RQ���R&���t���objt���typet ���ClassTypet ���baseclasst ���issubclasst ���annotatedR���( ���RP���RY���R[���RX���RZ���RV���R&���RU���R?���(����(����R���t���find_classes ��s�������c��� ������C���s}���g��}�xp�|��D]h�}�x_�|�i�i�ƒ��D]N�\�}�}�t�|�|�ƒ�o2�|�o�|�i �|�|�|�f�ƒ�qq�|�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 ���instancesRP���R?���R8���RQ���R&���RV���t ���isinstanceRY���R[���R���( ���RP���RY���R[���t���InstanceTypeRZ���RV���R&���R]���R?���(����(����R���t���find_instances!��s�������(,���t���__doc__t���__version__R���t���typesR1���t���stringt���ret���impt���__builtin__t���mx.Tools.NewBuiltinst���mxt ���projectiont���get_suffixest���suffixest���compileR���R ���R���t���curdirR ���R���R���R���R���R���R'���R)���R*���R-���R3���t ���__import__R@���RF���RG���RI���RJ���RK���R2���RT���RX���RZ���R\���R_���R`���(���R3���R���Rg���RF���RJ���Re���RT���R`���R)���RG���Rf���Rb���Rd���R1���R\���RI���R���Rc���R2���R ���R���Ri���Rl���(����(����R���t���? ���s"���? ##B3($