o
     Þ‚i—  ã                   @   s<   d dl Z d dlZd dlmZ ddlmZ dd„ Zdd„ ZdS )	é    N)Úurlsplité   )ÚBASE_DIRc               
   C   sJ   zt  ¡ } tj tj td¡¡}|  |¡ | W S  ty$ } z‚ d }~ww )Nz
config.ini)	ÚconfigparserÚConfigParserÚosÚpathÚnormpathÚjoinr   ÚreadÚ	Exception)ÚconfigÚconfig_file_pathÚe© r   ú+/home/acert/hirelines/hirelines/metadata.pyÚ	getConfig   s   
€ÿr   c              
   C   s†   z(d| j vr	W dS | j d }t|ƒj}tƒ d d }| d¡}||vr&W dS W dS  tyB } ztdt|ƒƒ W Y d }~dS d }~ww )NÚHTTP_ORIGINFÚREFERRERÚallowed_domainsú,TzError checking referrer: )ÚMETAr   Úhostnamer   Úsplitr   ÚprintÚstr)ÚrequestÚreferrerÚreferrer_hostÚmedia_responseÚallowed_referrersr   r   r   r   Úcheck_referrer   s   



€þr!   )r   r   Úurllib.parser   Úsettingsr   r   r!   r   r   r   r   Ú<module>   s    