
    ןEf	                     B     G d  de           Z G d dee          ZdS )c                   "     e Zd Zi Z fdZ xZS )	Singletonc                     | | j         vr( t          t          |           j        |i || j         | <   | j         |          S N)
_instancessuperr   __call__)clsargskwargs	__class__s      ./cmf/import_table.pyr   zSingleton.__call__   sE    cn$$"@%	3"7"7"@$"Q&"Q"QCN3~c""    )__name__
__module____qualname__r   r   __classcell__)r   s   @r   r   r      s=        J# # # # # # # # #r   r   c                   &    e Zd Zd Zd Zd Zd ZdS )ImportTablec                 2    t          d           i | _        d S )NINIT)printimport_tableselfs    r   __init__zImportTable.__init__
   s    fr   c                     d S r    r   s    r   initzImportTable.init   s    r   c                 H    d}i t           d<   t          t           |           d S )N/)
GLOBAL_IMPORT_TABLEmake_import_configoswalkPROJECT_DIRreplacer   pathjoinremove)r   import_prefixdirnamedirnames	filenames
subdirnamefilenames          r   make_import_tablezImportTable.make_import_table   s*    #%C .>>>
 	r   c                    |dk    rt                               dd           }i }t          j                            t          j                            t          dd                    rt                               dd           }|j                                        D ]\  }}t          |||           |||         d<   d S d                    d	 |
                    d          D                       }t                               |d
z   d           }i }t          j                            t          j                            t          |dd                    rt                               |dz   d           }|j                                        D ]\  }}t          |||           |d         d                                         }	|j                                        D ]\  }}t          |	||           |	||         d<   d S )Nr    zcommon.config)packagecustomz	config.pyzcustom.configconfig.c              3      K   | ]}||V  	d S r   r   ).0vs     r   	<genexpr>z1ImportTable.make_import_config.<locals>.<genexpr>5   s'      "L"L!"L1"L"L"L"L"L"Lr   z.config)	importlibimport_moduler#   r'   existsr(   r%   __dict__itemssetattrsplitcopy)
r   r   r*   config_modulecustom_config_modulecustom_import_modulekr8   module_pathglobal_configs
             r   r"   zImportTable.make_import_config*   s   C%33OT3RRM#% w~~bgll;+NNOO ^'0'>'>X\'>']']$,5;;== - -1q!,,,,4AL'111(("L"Lm.A.A#.F.F"L"L"LLLK%33K	4ISW3XXM#% w~~bgll;xQ\]]^^ j'0'>'>{??Zdh'>'i'i$,5;;== - -1q!,,,,(-h7<<>>M%.4466 - -1q!,,,,4AL'111r   N)r   r   r   r   r   r0   r"   r   r   r   r   r   	   sU            
( ( (.B B B B Br   r   )	metaclassN)typer   objectr   r   r   r   <module>rK      su   # # # # # # # #7B 7B 7B 7B 7B&I 7B 7B 7B 7B 7B 7Br   