Skip to content

Commit

Permalink
--yes support
Browse files Browse the repository at this point in the history
  • Loading branch information
GitPaulo committed Dec 10, 2024
1 parent 428e2c9 commit dfa42b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/quests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
python -m pip install --upgrade pip
pip install pandas requests tqdm
- name: Run Quest Data Scraper
run: npm run quests
- name: Run prepare_quest_data.py
run: npm run quests -- --auto-yes

- name: Commit Updated Quests.json
run: |
Expand Down
18 changes: 15 additions & 3 deletions data/prepare_quest_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
import json
import requests
import time
import argparse

from tqdm import tqdm
from io import StringIO

'''
Arguments
'''

parser = argparse.ArgumentParser(description="Process quest data.")
parser.add_argument('--auto-yes', action='store_true', help="Automatically assume 'yes' for all prompts.")
args = parser.parse_args()

# Check if auto-yes is enabled for GA
auto_yes = args.auto_yes

'''
Constants
'''
Expand Down Expand Up @@ -201,13 +213,13 @@ def convert_quest_fields_to_numbers(quest):
filtered_data = filtered_data[filtered_data.iloc[:, -2] == False]

# Prompt user if they want to fetch images
fetch_images = input("Do you want to fetch images? (yes/no): ").strip().lower() == 'yes'
fetch_images = True if auto_yes else input("Do you want to fetch images? (yes/no): ").strip().lower() == 'yes'

# Prompt user if they want to fetch journal entries
fetch_journal_entries = input("Do you want to fetch journal entries? (yes/no): ").strip().lower() == 'yes'
fetch_journal_entries = True if auto_yes else input("Do you want to fetch journal entries? (yes/no): ").strip().lower() == 'yes'

# Prompt user if they want to fetch unlocks
fetch_unlocks = input("Do you want to fetch unlocks? (yes/no): ").strip().lower() == 'yes'
fetch_unlocks = True if auto_yes else input("Do you want to fetch unlocks? (yes/no): ").strip().lower() == 'yes'

# # -> Quest (formatted) mapping
quests_by_number = {}
Expand Down

0 comments on commit dfa42b5

Please sign in to comment.