2022-06-19 06:45:36 +12:00
|
|
|
"""
|
|
|
|
Shared controller resources module
|
|
|
|
|
|
|
|
Each of the objects in this module should be instantiated ONCE
|
|
|
|
and only ONCE!
|
|
|
|
"""
|
|
|
|
|
2022-09-04 10:14:43 +12:00
|
|
|
import logging
|
2021-10-08 07:19:24 +13:00
|
|
|
from argparse import Namespace
|
2022-09-05 05:38:24 +12:00
|
|
|
from typing import Optional
|
2021-10-08 07:19:24 +13:00
|
|
|
|
2022-04-19 02:51:51 +12:00
|
|
|
from rare.lgndr.core import LegendaryCore
|
2022-06-19 06:45:36 +12:00
|
|
|
from rare.models.signals import GlobalSignals
|
2022-09-05 05:38:24 +12:00
|
|
|
from .image_manager import ImageManager
|
|
|
|
from .rare_core import RareCore
|
2021-10-08 07:19:24 +13:00
|
|
|
|
2022-09-05 05:38:24 +12:00
|
|
|
logger = logging.getLogger("Shared")
|
2022-09-04 10:14:43 +12:00
|
|
|
|
2021-10-08 07:19:24 +13:00
|
|
|
|
2022-09-05 05:38:24 +12:00
|
|
|
def ArgumentsSingleton() -> Optional[Namespace]:
|
|
|
|
return RareCore.instance().args()
|
2021-10-08 07:19:24 +13:00
|
|
|
|
|
|
|
|
2022-09-05 05:38:24 +12:00
|
|
|
def GlobalSignalsSingleton() -> GlobalSignals:
|
|
|
|
return RareCore.instance().signals()
|
2021-10-08 07:19:24 +13:00
|
|
|
|
|
|
|
|
2022-09-05 05:38:24 +12:00
|
|
|
def LegendaryCoreSingleton() -> LegendaryCore:
|
|
|
|
return RareCore.instance().core()
|
2021-10-08 07:19:24 +13:00
|
|
|
|
|
|
|
|
2022-09-05 05:38:24 +12:00
|
|
|
def ImageManagerSingleton() -> ImageManager:
|
|
|
|
return RareCore.instance().image_manager()
|