uwefladrich/scriptengine

Add `basename` and `dirname` filters for Jinja2

Closed this issue · 1 comments

These filters are often useful.

Implement like

def basename(path):
    return os.path.basename(path)

def dirname(path):
    return os.path.dirname(path)

and then

environment.filters['basename'] = basename
environment.filters['dirname']  = dirname