in isshub.domain.contexts.code_repository.repositories View Git history

“namespace” package

namespace

Package defining the repository for the Namespace entity.

class AbstractNamespaceRepository(*args, **kwds)[source]

Bases: isshub.domain.utils.repository.AbstractRepository

Base repository for the Namespace entity.

abstract for_namespace(namespace)[source]

Iterate on namespaces found in the given namespace, or with no namespace if None.

Parameters

namespace (Union[Namespace, None]) – The namespace for which we want to find the namespaces. If None, will look for namespaces having no parent namespace.

Returns

An iterable of the namespaces found in the namespace (or that have no namespace if namespace is None)

Return type

Iterable[Namespace]

exception NotFoundError(message, repository=None)

Bases: isshub.domain.utils.repository.NotFoundError

repository

alias of isshub.domain.contexts.code_repository.repositories.namespace.AbstractNamespaceRepository

exception UniquenessError(message, repository=None)

Bases: isshub.domain.utils.repository.UniquenessError

repository

alias of isshub.domain.contexts.code_repository.repositories.namespace.AbstractNamespaceRepository

entity_class

alias of isshub.domain.contexts.code_repository.entities.namespace.Namespace

class InMemoryNamespaceRepository[source]

Bases: isshub.domain.utils.repository.AbstractInMemoryRepository, isshub.domain.contexts.code_repository.repositories.namespace.AbstractNamespaceRepository

Repository to handle Namespace entities in memory.

add(entity)[source]

Add the given Namespace entity in the repository.

For the parameters, see AbstractRepository.add.

Returns

The added Namespace

Return type

Namespace

Raises

self.UniquenessError

  • If a namespace with the same identifier as the given one already exists. - If a namespace with the same name and parent namespace (including no namespace) as the given one already exists.

for_namespace(namespace)[source]

Iterate on namespaces found in the given namespace, or with no namespace if None.

For the parameters, see AbstractNamespaceRepository.for_namespace

Returns

An iterable of the namespaces found in the namespace

Return type

Iterable[Namespace]

exception NotFoundError(message, repository=None)

Bases: isshub.domain.utils.repository.NotFoundError

repository

alias of isshub.domain.contexts.code_repository.repositories.namespace.InMemoryNamespaceRepository

exception UniquenessError(message, repository=None)

Bases: isshub.domain.utils.repository.UniquenessError

repository

alias of isshub.domain.contexts.code_repository.repositories.namespace.InMemoryNamespaceRepository

entity_class

alias of isshub.domain.contexts.code_repository.entities.namespace.Namespace