1
0
Fork 0
mirror of synced 2024-06-18 02:24:43 +12:00
Rare/rare/shared/__init__.py

34 lines
756 B
Python
Raw Permalink Normal View History

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