Skip to content

Commit

Permalink
fix prompt menu
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Aug 8, 2024
1 parent 14cf716 commit f464ce9
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions ofscraper/prompts/prompt_groups/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ def funct(prompt_):
[Performance Options]
download_sems: number of downloads per processor/worker
thread_count: number of processors/workers
download_limit: max download speed per second for each thread
-----------------------------------
[Content Filter Options]
block_ads: use common key words to block ads
--------------------------------------------------
[Scripts Options]
post_download_script: script to run after actions on each model
post_script: script to run after all models are processed
--------------------------------------------------
[Advanced Options]
code-execution: allow eval on custom_val
dynamic-mode-default: source of signed header values
Expand Down Expand Up @@ -305,7 +310,7 @@ def script_config():
{
"type": "input",
"name": "post_download_script",
"message": "Script to run after each model download",
"message": "Script to run after each model is processed",
"default": data.get_post_download_script() or "",
"option_instruction": "Leave empty to skip post download script",
},
Expand Down Expand Up @@ -390,7 +395,7 @@ def performance_config():
out.update(threads)
max_allowed = get_max_sems(threads)

answer = promptClasses.batchConverter(
sems = promptClasses.batchConverter(
*[
{
"type": "number",
Expand All @@ -406,7 +411,30 @@ def performance_config():
altx=funct,
more_instruction=prompt_strings.CONFIG_MENU,
)
out.update(answer)
out.update(sems)

speed = promptClasses.batchConverter(
*[
{
"type": "input",
"name": "download_limit",
"message": "Maximum download speed per second for each thread: ",
"validate": EmptyInputValidator(),
"option_instruction": \
"""
Input can be int representing bytes
or human readable such as 10mb
""",
"default": str(data.get_download_limit()),
"filter": lambda x:int(x) if x!="None" else 0
}
],
altx=funct,
more_instruction=prompt_strings.CONFIG_MENU,
)
out.update(speed)


config = config_file.open_config()
config.update(out)
final = schema.get_current_config_schema({"config": config})
Expand Down

0 comments on commit f464ce9

Please sign in to comment.