fix pyright alongside some improvements
This commit is contained in:
parent
a96c4c5637
commit
5702947192
@ -101,7 +101,7 @@ class Templates(SimpleNamespace):
|
||||
AI = "ai"
|
||||
|
||||
# The option for the user to choose a remote template.
|
||||
CHOOSE_TEMPLATES = "choose templates"
|
||||
CHOOSE_TEMPLATES = "choose-templates"
|
||||
|
||||
# The reflex.build frontend host
|
||||
REFLEX_BUILD_FRONTEND = "https://flexgen.reflex.run"
|
||||
|
@ -1223,7 +1223,9 @@ def prompt_for_template_options(templates: list[Template]) -> str:
|
||||
|
||||
# Prompt the user to select a template.
|
||||
id_to_name = {
|
||||
str(idx): f"{template.name} ({template.demo_url}) - {template.description}"
|
||||
str(
|
||||
idx
|
||||
): f"{template.name.replace('_', ' ').replace('-', ' ')} ({template.demo_url}) - {template.description}"
|
||||
for idx, template in enumerate(templates)
|
||||
}
|
||||
for id in range(len(id_to_name)):
|
||||
@ -1489,8 +1491,8 @@ def fetch_and_prompt_with_remote_templates(
|
||||
if not show_prompt and template in available_templates:
|
||||
return template, available_templates
|
||||
|
||||
if not show_prompt and (template not in templates):
|
||||
console.error(f"{template} is not a valid template name.")
|
||||
if not show_prompt and (template not in available_templates):
|
||||
console.error(f"{template!r} is not a valid template name.")
|
||||
|
||||
template = (
|
||||
prompt_for_remote_template_selection(available_templates)
|
||||
|
Loading…
Reference in New Issue
Block a user