mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 23:13:46 +08:00
Add files via upload
This commit is contained in:
parent
b86c57c4d3
commit
5facde513f
@ -7,7 +7,6 @@ from __future__ import annotations
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from ba import print_exception
|
|
||||||
import _ba
|
import _ba
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@ -35,28 +34,32 @@ class PluginSubsystem:
|
|||||||
try:
|
try:
|
||||||
plugin.on_app_launch()
|
plugin.on_app_launch()
|
||||||
except Exception:
|
except Exception:
|
||||||
print_exception('Error in plugin on_app_launch()')
|
from ba import _error
|
||||||
|
_error.print_exception('Error in plugin on_app_launch()')
|
||||||
|
|
||||||
def on_app_pause(self) -> None:
|
def on_app_pause(self) -> None:
|
||||||
for plugin in self.active_plugins.values():
|
for plugin in self.active_plugins.values():
|
||||||
try:
|
try:
|
||||||
plugin.on_app_pause()
|
plugin.on_app_pause()
|
||||||
except Exception:
|
except Exception:
|
||||||
print_exception('Error in plugin on_app_pause()')
|
from ba import _error
|
||||||
|
_error.print_exception('Error in plugin on_app_pause()')
|
||||||
|
|
||||||
def on_app_resume(self) -> None:
|
def on_app_resume(self) -> None:
|
||||||
for plugin in self.active_plugins.values():
|
for plugin in self.active_plugins.values():
|
||||||
try:
|
try:
|
||||||
plugin.on_app_resume()
|
plugin.on_app_resume()
|
||||||
except Exception:
|
except Exception:
|
||||||
print_exception('Error in plugin on_app_resume()')
|
from ba import _error
|
||||||
|
_error.print_exception('Error in plugin on_app_resume()')
|
||||||
|
|
||||||
def on_app_shutdown(self) -> None:
|
def on_app_shutdown(self) -> None:
|
||||||
for plugin in self.active_plugins.values():
|
for plugin in self.active_plugins.values():
|
||||||
try:
|
try:
|
||||||
plugin.on_app_shutdown()
|
plugin.on_app_shutdown()
|
||||||
except Exception:
|
except Exception:
|
||||||
print_exception('Error in plugin on_app_shutdown()')
|
from ba import _error
|
||||||
|
_error.print_exception('Error in plugin on_app_shutdown()')
|
||||||
|
|
||||||
def load_plugins(self) -> None:
|
def load_plugins(self) -> None:
|
||||||
"""(internal)"""
|
"""(internal)"""
|
||||||
@ -83,7 +86,8 @@ class PluginSubsystem:
|
|||||||
assert plugkey not in self.active_plugins
|
assert plugkey not in self.active_plugins
|
||||||
self.active_plugins[plugkey] = plugin
|
self.active_plugins[plugkey] = plugin
|
||||||
except Exception:
|
except Exception:
|
||||||
print_exception(f'Error loading plugin: {plugkey}')
|
from ba import _error
|
||||||
|
_error.print_exception(f'Error loading plugin: {plugkey}')
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user