def mk_template_paths(filepath, paths=None):
    """
    Make template paths from given filepath and paths list.

    :param filepath: (Base) filepath of template file or None
    :param paths: A list of template search paths or None

    >>> mk_template_paths("/tmp/t.j2", [])
    ['/tmp']
    >>> mk_template_paths("/tmp/t.j2", ["/etc"])
    ['/etc', '/tmp']
    >>> mk_template_paths(None, ["/etc"])
    ['/etc']
    """
    if filepath is None:
        return [os.curdir] if paths is None else paths

    tmpldir = os.path.dirname(os.path.abspath(filepath))
    return [tmpldir] if paths is None else paths + [tmpldir]
def mk_template_paths ( filepath , paths = None ) : if filepath is None : return [ os . curdir ] if paths is None else paths tmpldir = os . path . dirname ( os . path . abspath ( filepath ) ) return [ tmpldir ] if paths is None else paths + [ tmpldir ]
Make template paths from given filepath and paths list.

    :param filepath: (Base) filepath of template file or None
    :param paths: A list of template search paths or None

    >>> mk_template_paths("/tmp/t.j2", [])
    ['/tmp']
    >>> mk_template_paths("/tmp/t.j2", ["/etc"])
    ['/etc', '/tmp']
    >>> mk_template_paths(None, ["/etc"])
    ['/etc']