From feb681d1ea7d6b1949208550027f56054db351c8 Mon Sep 17 00:00:00 2001 From: Elijah Date: Mon, 11 Nov 2024 14:51:06 +0000 Subject: [PATCH] fix pyright message --- reflex/reflex.py | 3 ++- reflex/utils/prerequisites.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reflex/reflex.py b/reflex/reflex.py index 6c8dda8ee..b0aa51090 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -120,8 +120,9 @@ def _init( # Initialize the requirements.txt. prerequisites.initialize_requirements_txt() + template_msg = "" if template else f" using the {template} template" # Finish initializing the app. - console.success(f"Initialized {app_name} using the {template} template") + console.success(f"Initialized {app_name}{template_msg}") @cli.command() diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 96487fc2f..b2b3b7f3b 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -1378,7 +1378,7 @@ def create_config_init_app_from_remote_template(app_name: str, template_url: str shutil.rmtree(unzip_dir) -def initialize_app(app_name: str, template: str | None = None) -> str: +def initialize_app(app_name: str, template: str | None = None) -> str | None: """Initialize the app either from a remote template or a blank app. If the config file exists, it is considered as reinit. Args: @@ -1387,6 +1387,9 @@ def initialize_app(app_name: str, template: str | None = None) -> str: Raises: Exit: If template is directly provided in the command flag and is invalid. + + Returns: + The name of the template. """ # Local imports to avoid circular imports. from reflex.utils import telemetry