B
    rnd
                 @   st   d Z ddlZdd Zdd Zdd Ze Ze Zed	Zed
ZedZ	edZ
edZedZedZedZdS )u=  
This module is used to store environmental variables in PaddleHub.


HUB_HOME              -->  the root directory for storing PaddleHub related data. Default to ~/.paddlehub. Users can change the
├                          default value through the HUB_HOME environment variable.
├── MODULE_HOME       -->  Store the installed PaddleHub Module.
├── CACHE_HOME        -->  Store the cached data.
├── DATA_HOME         -->  Store the automatically downloaded datasets.
├── CONF_HOME         -->  Store the default configuration files.
├── THIRD_PARTY_HOME  -->  Store third-party libraries.
├── TMP_HOME          -->  Store temporary files generated during running, such as intermediate products of installing modules,
├                          files in this directory will generally be automatically cleared.
├── SOURCES_HOME      -->  Store the installed code sources.
└── LOG_HOME          -->  Store log files generated during operation, including some non-fatal errors. The log will be stored
                           daily.
    Nc               C   s   t jdS )N~)ospath
expanduser r   r   1/tmp/pip-unpacked-wheel-a87ls_x8/paddlehub/env.py_get_user_home$   s    r   c              C   sT   dt jkrDt jd } t j| r@t j| r0| S td| n| S t jt dS )NHUB_HOMEz8The environment variable HUB_HOME {} is not a directory.z
.paddlehub)	r   environr   existsisdirRuntimeErrorformatjoinr   )Z	home_pathr   r   r   _get_hub_home(   s    

r   c             C   s"   t jt | }t j|dd |S )NT)exist_ok)r   r   r   r   makedirs)	directoryhomer   r   r   _get_sub_home5   s    r   modulescacheZdatasetconfZ
thirdpartytmpsourceslog)__doc__r   r   r   r   Z	USER_HOMEr	   ZMODULE_HOMEZ
CACHE_HOMEZ	DATA_HOMEZ	CONF_HOMEZTHIRD_PARTY_HOMEZTMP_HOMEZSOURCES_HOMEZLOG_HOMEr   r   r   r   <module>   s   