def clean_all_draft_pages_from_all_spaces(confluence, days=30):
    """
    Remove all draft pages for all spaces older than DRAFT_DAYS
    :param days: int
    :param confluence:
    :return:
    """
    date_now = datetime.datetime.now()
    count = 0
    limit = 50
    flag = True
    i = 0
    while flag:
        space_lists = confluence.get_all_spaces(start=i * limit, limit=limit)
        if space_lists and len(space_lists) != 0:
            i += 1
            for space_list in space_lists:
                print("Start review the space {}".format(space_list['key']))
                count = clean_draft_pages_from_space(confluence=confluence, space_key=space_list['key'], count=count,
                                                     date_now=date_now)
        else:
            flag = False
    print("Script has removed {count} draft pages older than {days} days".format(count=count, days=days))
Remove all draft pages for all spaces older than DRAFT_DAYS
    :param days: int
    :param confluence:
    :return: