weaver.config ============= .. py:module:: weaver.config Module Contents --------------- .. py:data:: LOGGER .. py:class:: WeaverConfiguration Configuration mode for which the `Weaver` instance should operate to provide different functionalities. .. py:attribute:: DEFAULT :value: 'DEFAULT' .. py:attribute:: ADES :value: 'ADES' .. py:attribute:: EMS :value: 'EMS' .. py:attribute:: HYBRID :value: 'HYBRID' .. py:class:: WeaverFeature Features enabled accordingly to different combinations of :class:`WeaverConfiguration` modes. .. py:attribute:: REMOTE .. py:attribute:: QUOTING .. py:data:: WEAVER_DEFAULT_INI_CONFIG :value: 'weaver.ini' .. py:data:: WEAVER_DEFAULT_DATA_SOURCES_CONFIG :value: 'data_sources.yml' .. py:data:: WEAVER_DEFAULT_REQUEST_OPTIONS_CONFIG :value: 'request_options.yml' .. py:data:: WEAVER_DEFAULT_WPS_PROCESSES_CONFIG :value: 'wps_processes.yml' .. py:data:: WEAVER_DEFAULT_CONFIGS .. py:function:: get_weaver_configuration(container: weaver.typedefs.AnySettingsContainer) -> str Obtains the defined operation configuration mode. :returns: one value amongst :py:data:`weaver.config.WEAVER_CONFIGURATIONS`. .. py:function:: get_weaver_config_file(file_path: Optional[str], default_config_file: str, generate_default_from_example: bool = True) -> str Validates that the specified configuration file can be found, or falls back to the default one. Handles 'relative' paths for settings in :data:`WEAVER_DEFAULT_INI_CONFIG` referring to other configuration files. Default file must be one of :data:`WEAVER_DEFAULT_CONFIGS`. If both the specified file and the default file cannot be found, default file under ``WEAVER_DEFAULT_INI_CONFIG`` is auto-generated from the corresponding ``.example`` file if :paramref:`generate_default_from_example` is ``True``. If it is ``False``, an empty string is returned instead without generation since no existing file can be guaranteed, and it is up to the caller to handle this situation as it explicitly disabled generation. :param file_path: path to a configuration file (can be relative if resolvable or matching a default file name) :param default_config_file: one of :py:data:`WEAVER_DEFAULT_CONFIGS`. :param generate_default_from_example: enable fallback copy of default configuration file from corresponding example. :returns: absolute path of the resolved file. .. py:function:: includeme(config: pyramid.config.Configurator) -> None