mirror of
https://github.com/PaiGramTeam/GramCore.git
synced 2024-11-24 15:19:21 +00:00
18 lines
507 B
Python
18 lines
507 B
Python
|
from typing import Optional, TYPE_CHECKING
|
||
|
|
||
|
if TYPE_CHECKING:
|
||
|
from gram_core.application import Application
|
||
|
|
||
|
|
||
|
class ApplicationMethod:
|
||
|
_application: "Optional[Application]" = None
|
||
|
|
||
|
def set_application(self, application: "Application") -> None:
|
||
|
self._application = application
|
||
|
|
||
|
@property
|
||
|
def application(self) -> "Application":
|
||
|
if self._application is None:
|
||
|
raise RuntimeError("No application was set for this PluginManager.")
|
||
|
return self._application
|