Skip to content

Commit

Permalink
redownload menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Aug 28, 2024
1 parent 842d881 commit c5198ef
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ofscraper/prompts/prompt_groups/actions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from InquirerPy.separator import Separator
import arrow
from prompt_toolkit.shortcuts import prompt as prompt

import ofscraper.prompts.promptConvert as promptClasses
import ofscraper.utils.args.accessors.read as read_args
import ofscraper.utils.args.mutators.write as write_args
import ofscraper.utils.constants as constants
from InquirerPy.base import Choice



def action_prompt() -> int:
Expand All @@ -18,7 +21,22 @@ def action_prompt() -> int:
)
args = read_args.retriveArgs()
action = constants.getattr("actionPromptChoices")[answer]
if "download" in action and not args.redownload:
args=redownload_prompt()
if isinstance(action, str):
return action
args.action = action
write_args.setArgs(args)


def redownload_prompt() -> int:
args = read_args.retriveArgs()
answer = promptClasses.getChecklistSelection(
message="Would you like to redownload all files",
choices=[Choice(True,"Yes"),Choice(False,"No")]
)
if answer:
args.force_all=True
args.no_api_cache=True
args.after=arrow.get(2000)
return args

0 comments on commit c5198ef

Please sign in to comment.