o
    3g                     @   s   d Z dddZe  [dS )a  
A hook to insert user's config directory into Python's search path.
Note that this file is imported only if we don't have custom user config (under my.config namespace) in PYTHONPATH

Ideally that would be in __init__.py (so it's executed without having to import explicitly)
But, with namespace packages, we can't have __init__.py in the parent subpackage
(see http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-init-py-trap)

Instead, this is imported in the stub config (in this repository), so if the stub config is used, it triggers import of the 'real' config.

Please let me know if you are aware of a better way of dealing with this!
returnNc                  C   sB  dd l } dd l}ddlm} ddlm} | }| s*|jd| d dd d S t	|}| j
d| d| jv r>| jd= zdd l}W n' tyk } zdd l}|| |jd	| d
dd W Y d }~d S d }~ww t|jdd }	|	d ur||	}
z|
| W d S  ty   |jd| d|
 d| ddd Y d S w d S )N    )Path   )get_mycfg_dirz0
'my.config' package isn't found! (expected at 'z'). This is likely to result in issues.
See https://github.com/karlicoss/HPI/blob/master/doc/SETUP.org#setting-up-the-modules for more info.
)
stacklevelz	my.configz'
Importing 'my.config' failed! (error: z). This is likely to result in issues.
See https://github.com/karlicoss/HPI/blob/master/doc/SETUP.org#setting-up-the-modules for more info.
__file__z%
Expected my.config to be located at z, but instead its path is z>.
This will likely cause issues down the line -- double check zq structure.
See https://github.com/karlicoss/HPI/blob/master/doc/SETUP.org#setting-up-the-modules for more info.
)syswarningspathlibr   preinitr   existswarnstripstrpathinsertmodules	my.configImportErrorlogging	exceptiongetattrconfigrelative_to
ValueError)r   r	   r   r   	mycfg_dirmpathmyexr   used_config_fileused_config_path r!   &/home/garg/my-data/HPI/my/core/init.pysetup_config   s\   

r#   )r   N)__doc__r#   r!   r!   r!   r"   <module>   s    
8