def walk_files(args, root, directory, action):
    """
    Recusively go do the subdirectories of the directory,
    calling the action on each file

    """
    for entry in os.listdir(directory):
        if is_hidden(args, entry):
            continue
        if is_excluded_directory(args, entry):
            continue
        if is_in_default_excludes(entry):
            continue
        if not is_included(args, entry):
            continue
        if is_excluded(args, entry, directory):
            continue
        entry = os.path.join(directory, entry)
        if os.path.isdir(entry):
            walk_files(args, root, entry, action)
        if os.path.isfile(entry):
            if is_binary(entry):
                continue
            action(entry)
Recusively go do the subdirectories of the directory,
    calling the action on each file