mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-07 06:18:05 +03:00
68 lines
1.9 KiB
Python
68 lines
1.9 KiB
Python
# Copyright (C) 2024–present Loren Eteval & contributors <loren.eteval@proton.me>
|
||
#
|
||
# This file is part of Furious.
|
||
#
|
||
# This program is free software: you can redistribute it and/or modify
|
||
# it under the terms of the GNU General Public License as published by
|
||
# the Free Software Foundation, either version 3 of the License, or
|
||
# (at your option) any later version.
|
||
#
|
||
# This program is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
# GNU General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU General Public License
|
||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
||
"""Provide bundled globals."""
|
||
|
||
from __future__ import annotations
|
||
|
||
from PySide6.QtWidgets import QApplication
|
||
|
||
import functools
|
||
|
||
__all__ = [
|
||
'APP',
|
||
'AppConnectionController',
|
||
'AppFontName',
|
||
'AppLogManager',
|
||
'AppLogPage',
|
||
'AppMainWindow',
|
||
'AppRoutingController',
|
||
'AppSettingsController',
|
||
'AppSystemTray',
|
||
'AppThreadPool',
|
||
]
|
||
|
||
APP = functools.partial(QApplication.instance)
|
||
|
||
|
||
def getAppAttributes(name: str):
|
||
"""Return app attributes."""
|
||
return getattr(APP(), name)
|
||
|
||
|
||
(
|
||
AppConnectionController,
|
||
AppFontName,
|
||
AppLogManager,
|
||
AppLogPage,
|
||
AppMainWindow,
|
||
AppRoutingController,
|
||
AppSettingsController,
|
||
AppSystemTray,
|
||
AppThreadPool,
|
||
) = (
|
||
functools.partial(getAppAttributes, 'connectionController'),
|
||
functools.partial(getAppAttributes, 'customFontName'),
|
||
functools.partial(getAppAttributes, 'logManager'),
|
||
functools.partial(getAppAttributes, 'logPage'),
|
||
functools.partial(getAppAttributes, 'mainWindow'),
|
||
functools.partial(getAppAttributes, 'routingController'),
|
||
functools.partial(getAppAttributes, 'settingsController'),
|
||
functools.partial(getAppAttributes, 'systemTray'),
|
||
functools.partial(getAppAttributes, 'threadPool'),
|
||
)
|