change PyappApplication to PyApplication

This commit is contained in:
2025-09-02 16:29:28 +08:00
parent d70eaf383b
commit 7e520e685a
3 changed files with 10 additions and 10 deletions

View File

@@ -17,19 +17,19 @@ def run():
app_name = "default"
if len(application_class) == 0:
Log.error("No class annotated with @PyappApplication found.", True)
Log.error("No class annotated with @PyApplication found.", True)
if len(sys.argv) < 3 and "default" not in application_class:
Log.error("No default @PyappApplication found. Please specify the 'name' parameter.", True)
Log.error("No default @PyApplication found. Please specify the 'name' parameter.", True)
if len(sys.argv) == 3:
app_name = sys.argv[2]
app_cls = application_class.get(app_name)
if app_cls is None:
Log.error(f"No class annotated with @PyappApplication found with the name '{app_name}'.", True)
Log.error(f"No class annotated with @PyApplication found with the name '{app_name}'.", True)
if not hasattr(app_cls, "start"):
Log.error("The class annotated with @PyappApplication should have a 'start' method.", True)
Log.error("The class annotated with @PyApplication should have a 'start' method.", True)
Log.info(f"Application '{app_cls.__name__}' started.")
timer = Timer(f"Application({app_name})")