B
    ÔùÓ`%  ã               @   sr   d Z ddlZddlZddlZddœdd„Zejeejf ddœdd„Zej	d	ej
f ej	d	ej
f d
œdd„ZdS )z-Utility functions in anyconfig.backend.base.
é    N)Úreturnc              O   s
   t ƒ ‚dS )z8
    Utility function to raise NotImplementedError.
    N)ÚNotImplementedError)Ú_argsÚ_kwargs© r   ú@/tmp/pip-unpacked-wheel-bpftjxoo/anyconfig/backend/base/utils.pyÚnot_implemented   s    r   )Úfilepathr   c             C   s   t  | ¡jjddd� dS )zl
    Make dir to dump 'filepath' if that dir does not exist.

    :param filepath: path of file to dump
    T)ÚparentsÚexist_okN)ÚpathlibÚPathÚparentÚmkdir)r	   r   r   r   Úensure_outdir_exists   s    r   .)Úfuncr   c                s   t  ˆ ¡‡ fdd„ƒ}|S )zŒ
    Lift :func:`func` to a method; it will be called with the first argument
    'self' ignored.

    :param func: Any callable object
    c                 s   ˆ | dd… |ŽS )zWrapper function.
        é   Nr   )ÚargsÚkwargs)r   r   r   Úwrapper$   s    zto_method.<locals>.wrapper)Ú	functoolsÚwraps)r   r   r   )r   r   Ú	to_method   s    r   )Ú__doc__r   r   Útypingr   ÚUnionÚstrr   r   ÚCallableZAnyr   r   r   r   r   Ú<module>   s   	