Source code for armpicom.setup.keys
# -*- coding: UTF-8 -*-
'''
Module
keys.py
Copyright
Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
armpicom 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.
armpicom 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 <http://www.gnu.org/licenses/>.
Info
Runtime components and interface constraints for the armpicom bundle.
'''
from __future__ import annotations
from typing import ClassVar
from types import MappingProxyType
from ats_utilities.base.setup.bundle import BaseBundle
from armpicom.core.service.iservice import IService
from armpicom.core.service.isubprocessor import ISubProcessor
from armpicom.infrastructure.cli.icli import ICLI
__author__ = 'Vladimir Roncevic'
__copyright__ = '(C) 2026, https://vroncevic.github.io/armpicom'
__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/armpicom/blob/dev/LICENSE'
__version__ = '2.0.3'
__maintainer__ = 'Vladimir Roncevic'
__email__ = 'elektron.ronca@gmail.com'
__status__ = 'Updated'
[docs]
class ARMPicomBundleKeys:
'''
Runtime components and interface constraints for the armpicom bundle.
It defines:
:attributes:
| DEPENDENCY_BASE - The base bundle constant for the armpicom bundle.
| DEPENDENCY_SERVICE - The service interface constant for the armpicom bundle.
| DEPENDENCY_SUBPROCESSOR - The subprocessor interface constant for the armpicom bundle.
| DEPENDENCY_CLI - The cli interface constant for the armpicom bundle.
| OPTION_INFO_FILE - The info file option constant for the armpicom bundle.
:methods:
| get_dependency_to_type - Returns the mapping of the armpicom bundle dependencies to their types.
| get_option_to_type - Returns the mapping of the armpicom bundle options to their types.
'''
# Dependency Keys
DEPENDENCY_BASE: ClassVar[str] = 'base'
DEPENDENCY_SERVICE: ClassVar[str] = 'service'
DEPENDENCY_SUBPROCESSOR: ClassVar[str] = 'subprocessor'
DEPENDENCY_CLI: ClassVar[str] = 'cli'
# Option Keys
OPTION_INFO_FILE: ClassVar[str] = 'info_file'
[docs]
@classmethod
def get_dependency_to_type(cls) -> MappingProxyType[str, type]:
'''
Returns the mapping of the armpicom bundle dependencies to their types.
:return: The mapping of the armpicom bundle dependencies to their types.
:exceptions: None.
'''
return MappingProxyType({
cls.DEPENDENCY_BASE: BaseBundle,
cls.DEPENDENCY_SERVICE: IService,
cls.DEPENDENCY_SUBPROCESSOR: ISubProcessor,
cls.DEPENDENCY_CLI: ICLI,
})
[docs]
@classmethod
def get_option_to_type(cls) -> MappingProxyType[str, type]:
'''
Returns the mapping of the armpicom bundle options to their types.
:return: The mapping of the armpicom bundle options to their types.
:exceptions: None.
'''
return MappingProxyType({
cls.OPTION_INFO_FILE: str,
})