Configuration Module¶
.. py:module:: sobe.config
Everything related to user configuration file.
.. py:class:: CacheConfig :module: sobe.config
Bases: :py:class:~typing.NamedTuple
CacheConfig(type, distribution)
.. py:method:: CacheConfig.new(_cls, type, distribution) :module: sobe.config :staticmethod:
Create new instance of CacheConfig(type, distribution)
.. py:attribute:: CacheConfig.distribution :module: sobe.config :type: str
Alias for field number 1
.. py:method:: CacheConfig.from_dict(target_name, raw) :module: sobe.config :classmethod:
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~typing.Self\``
.. py:attribute:: CacheConfig.type :module: sobe.config :type: str
Alias for field number 0
.. py:class:: Config :module: sobe.config
Bases: :py:class:~typing.NamedTuple
Config(targets, default)
.. py:method:: Config.new(_cls, targets, default) :module: sobe.config :staticmethod:
Create new instance of Config(targets, default)
.. py:attribute:: Config.default :module: sobe.config :type: str | None
Alias for field number 1
.. py:method:: Config.from_dict(raw) :module: sobe.config :classmethod:
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~typing.Self\``
.. py:method:: Config.is_unconfigured() :module: sobe.config
Whether the config still needs editing: no targets, or every bucket is the placeholder.
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`bool\``
.. py:method:: Config.select(name) :module: sobe.config
Return the target to operate on, applying the selection rules. An empty name counts as not given.
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~sobe.config.Target\``
.. py:attribute:: Config.targets :module: sobe.config :type: dict[str, ~sobe.config.Target]
Alias for field number 0
.. py:exception:: ConfigError :module: sobe.config
Bases: :py:class:Exception
Invalid configuration. The message names what is wrong and the user’s next step.
.. py:class:: Migration :module: sobe.config
Bases: :py:class:~typing.NamedTuple
Migration(path, backup)
.. py:method:: Migration.new(_cls, path, backup) :module: sobe.config :staticmethod:
Create new instance of Migration(path, backup)
.. py:attribute:: Migration.backup :module: sobe.config :type: ~pathlib.Path
Alias for field number 1
.. py:attribute:: Migration.path :module: sobe.config :type: ~pathlib.Path
Alias for field number 0
.. py:exception:: MustEditConfig :module: sobe.config
Bases: :py:class:Exception
Config file must be edited before this tool can be used.
.. py:method:: MustEditConfig.init(path, created=True) :module: sobe.config
.. py:class:: StorageConfig :module: sobe.config
Bases: :py:class:~typing.NamedTuple
StorageConfig(type, bucket)
.. py:method:: StorageConfig.new(_cls, type, bucket) :module: sobe.config :staticmethod:
Create new instance of StorageConfig(type, bucket)
.. py:attribute:: StorageConfig.bucket :module: sobe.config :type: str
Alias for field number 1
.. py:method:: StorageConfig.from_dict(target_name, raw) :module: sobe.config :classmethod:
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~typing.Self\``
.. py:attribute:: StorageConfig.type :module: sobe.config :type: str
Alias for field number 0
.. py:class:: Target :module: sobe.config
Bases: :py:class:~typing.NamedTuple
Target(name, storage, url, cache, aws_session, aws_service)
.. py:method:: Target.new(_cls, name, storage, url, cache, aws_session, aws_service) :module: sobe.config :staticmethod:
Create new instance of Target(name, storage, url, cache, aws_session, aws_service)
.. py:attribute:: Target.aws_service :module: sobe.config :type: dict[str, ~typing.Any]
Alias for field number 5
.. py:attribute:: Target.aws_session :module: sobe.config :type: dict[str, ~typing.Any]
Alias for field number 4
.. py:attribute:: Target.cache :module: sobe.config :type: ~sobe.config.CacheConfig | None
Alias for field number 3
.. py:method:: Target.from_dict(name, raw) :module: sobe.config :classmethod:
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~typing.Self\``
.. py:attribute:: Target.name :module: sobe.config :type: str
Alias for field number 0
.. py:attribute:: Target.storage :module: sobe.config :type: ~sobe.config.StorageConfig
Alias for field number 1
.. py:attribute:: Target.url :module: sobe.config :type: str | None
Alias for field number 2
.. py:function:: load_config() :module: sobe.config
:rtype: :sphinx_autodoc_typehints_type:\:py\:class\:\tuple`\ \[:py:class:`~sobe.config.Config`, :py:class:`~sobe.config.Migration` | :py:obj:`None`]`