:returns: True if file should not be included in the final archive

def _filter_files(path):
    """
    :returns: True if file should not be included in the final archive
    """
    s = os.path.normpath(path).split(os.path.sep)

    if path.endswith("snapshots"):
        return True

    # filter directory of snapshots
    if "{sep}snapshots{sep}".format(sep=os.path.sep) in path:
        return True

    try:
        i = s.index("project-files")
        if s[i + 1] in ("tmp", "captures", "snapshots"):
            return True
    except (ValueError, IndexError):
        pass

    file_name = os.path.basename(path)
    # Ignore log files and OS noises
    if file_name.endswith('_log.txt') or file_name.endswith('.log') or file_name == '.DS_Store':
        return True

    return False