change PyappApplication to PyApplication
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
from pyapp.utils.log import Log
|
||||
|
||||
application_class = {}
|
||||
def PyappApplication(arg=None):
|
||||
def PyApplication(arg=None):
|
||||
if callable(arg):
|
||||
cls = arg
|
||||
if "default" in application_class:
|
||||
Log.error("Multiple classes annotated with default @PyappApplication, require a 'name' parameter.", True)
|
||||
Log.error("Multiple classes annotated with default @PyApplication, require a 'name' parameter.", True)
|
||||
application_class["default"] = cls
|
||||
return cls
|
||||
|
||||
@@ -13,9 +13,9 @@ def PyappApplication(arg=None):
|
||||
name = arg
|
||||
def decorator(cls):
|
||||
if name is None:
|
||||
raise Log.error("The 'name' parameter is required when using @PyappApplication with arguments.", True)
|
||||
raise Log.error("The 'name' parameter is required when using @PyApplication with arguments.", True)
|
||||
if name in application_class:
|
||||
raise Log.error(f"Multiple classes annotated with @PyappApplication with the same name '{name}' found.", True)
|
||||
raise Log.error(f"Multiple classes annotated with @PyApplication with the same name '{name}' found.", True)
|
||||
application_class[name] = cls
|
||||
return cls
|
||||
return decorator
|
||||
|
||||
Reference in New Issue
Block a user