
    @d	                     4     G d  de       Z G d dee      Zy)c                   "     e Zd Zi Z fdZ xZS )	Singletonc                 ~    | | j                   vr t        t        |   |i || j                   | <   | j                   |    S N)
_instancessuperr   __call__)clsargskwargs	__class__s      ./cmf/import_table.pyr   zSingleton.__call__   s=    cnn$"'	3"@$"Q&"QCNN3~~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y)ImportTablec                 (    t        d       i | _        y )NINIT)printimport_tableselfs    r   __init__zImportTable.__init__
   s    fr   c                      y r    r   s    r   initzImportTable.init   s    r   c                 :    d}i t         d<   t        t         |       y )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         j                  dd       }i }t        j                  j	                  t        j                  j                  t        dd            rt         j                  dd       }j                  j                         D ]  \  }}t        |||        |||   d<   y dj                  d	 |j                  d      D              }t         j                  |d
z   d       }i }t        j                  j	                  t        j                  j                  t        |dd            rt         j                  |dz   d       }j                  j                         D ]  \  }}t        |||        |d   d   j                         }	|j                  j                         D ]  \  }}t        |	||        |	||   d<   y )Nr    zcommon.config)packagecustomz	config.pyzcustom.configconfig.c              3   &   K   | ]	  }|s|  y wr   r   ).0vs     r   	<genexpr>z1ImportTable.make_import_config.<locals>.<genexpr>5   s     "L!1"Ls   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RM#% ww~~bggll;+NO'0'>'>X\'>']$,55;;= -1q!,-4AL'1(("Lm.A.A#.F"LLK%33K	4ISW3XM#% ww~~bggll;xQ\]^'0'>'>{??Zdh'>'i$,55;;= -1q!,- )-h7<<>M%..446 -1q!,-4AL'1r   N)r   r   r   r   r   r0   r"   r   r   r   r   r   	   s    
(.Br   r   )	metaclassN)typer   objectr   r   r   r   <module>rK      s!   # #7B&I 7Br   