Override default Warning layout, from:

        /PATH/TO/dutree.py:326: UserWarning:
            [Errno 2] No such file or directory: '/0.d/05.d'
          warnings.warn(str(e))

    To:

        dutree.py:330: UserWarning:
            [Errno 2] No such file or directory: '/0.d/05.d'

def formatwarning(message, category, filename, lineno, line=None):
    """
    Override default Warning layout, from:

        /PATH/TO/dutree.py:326: UserWarning:
            [Errno 2] No such file or directory: '/0.d/05.d'
          warnings.warn(str(e))

    To:

        dutree.py:330: UserWarning:
            [Errno 2] No such file or directory: '/0.d/05.d'
    """
    return '{basename}:{lineno}: {category}: {message}\n'.format(
        basename=path.basename(filename), lineno=lineno,
        category=category.__name__, message=message)