1
0
Fork 0
mirror of synced 2024-05-26 23:40:05 +12:00
Rare/rare/shared/__init__.py
loathingKernel 5748d0e6ee
RareCore: Manage initialization in RareCore instead of LaunchDialog
This is the last change of the `backend_refactor` branch. This makes
`RareCore` the centerpiece of Rare by moving initialization before the UI
is brought up. RareCore is now in control of creating and querying `RareGame`
objects, re-introducing the ability (incomplete) to refresh the games library.
As a result, ApiResults has been removed.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-07 17:11:21 +02:00

34 lines
756 B
Python

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