def listdirs(path='.'):
    """generator that returns all directories of *path*"""
    import os
    for f in os.listdir(path):
        if isdir(join(path, f)):
            yield join(path, f) if path != '.' else f